Skip to content

Commit

Permalink
Merge pull request #14520 from brave/call_pin_to_taskbar_api_from_fir…
Browse files Browse the repository at this point in the history
…st_run

Run pin to task method from first run dialog
  • Loading branch information
simonhong committed Aug 8, 2022
2 parents 90e300d + d735e2c commit f97eca6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion browser/ui/views/brave_first_run_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#if BUILDFLAG(IS_WIN)
#include "brave/browser/brave_shell_integration.h"
#include "brave/browser/brave_shell_integration_win.h"
#else
#include "chrome/browser/shell_integration.h"
#endif
Expand Down Expand Up @@ -123,7 +124,13 @@ bool BraveFirstRunDialog::Accept() {

#if BUILDFLAG(IS_WIN)
base::MakeRefCounted<shell_integration::BraveDefaultBrowserWorker>()
->StartSetAsDefault(base::NullCallback());
->StartSetAsDefault(
base::BindOnce([](shell_integration::DefaultWebClientState state) {
if (state == shell_integration::DefaultWebClientState::IS_DEFAULT) {
// Try to pin to taskbar when Brave is set as a default browser.
shell_integration::win::PinToTaskbar();
}
}));
#else
shell_integration::SetAsDefaultBrowser();
#endif
Expand Down

0 comments on commit f97eca6

Please sign in to comment.