diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index 5a212496cc8..c9d5e4aa37d 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -1656,9 +1656,6 @@ Are you sure you want to do this? To ensure the best privacy online, consider setting Brave as the default browser on your computer. With Brave as default, any web link you click will open with Brave's privacy protections. - - Welcome to Brave - Networks diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn index 224d48522a6..fa97fe12d76 100644 --- a/browser/ui/BUILD.gn +++ b/browser/ui/BUILD.gn @@ -182,12 +182,12 @@ source_set("ui") { "views/web_discovery_dialog_view.h", ] - # Enable FirstRun dialog on Win. + # Use different FirstRun dialog UI on Win. # Upstream only includes it on mac/Linux. if (is_win) { sources += [ - "//chrome/browser/ui/views/first_run_dialog.cc", - "//chrome/browser/ui/views/first_run_dialog.h", + "views/first_run_dialog_win.cc", + "views/first_run_dialog_win.h", ] } diff --git a/browser/ui/views/first_run_dialog_win.cc b/browser/ui/views/first_run_dialog_win.cc new file mode 100644 index 00000000000..43e86dd2073 --- /dev/null +++ b/browser/ui/views/first_run_dialog_win.cc @@ -0,0 +1,16 @@ +/* Copyright (c) 2022 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "brave/browser/ui/views/first_run_dialog_win.h" + +#include "chrome/browser/first_run/first_run_dialog.h" + +namespace first_run { + +void ShowFirstRunDialog(Profile* profile) { + // TODO(simonhong): Launch FirstRunDialogWin. +} + +} // namespace first_run diff --git a/browser/ui/views/first_run_dialog_win.h b/browser/ui/views/first_run_dialog_win.h new file mode 100644 index 00000000000..b8a41c8d10a --- /dev/null +++ b/browser/ui/views/first_run_dialog_win.h @@ -0,0 +1,11 @@ +/* Copyright (c) 2022 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_WIN_H_ +#define BRAVE_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_WIN_H_ + +// TODO(simonhong): Implement FirstRunDialogWin. + +#endif // BRAVE_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_WIN_H_ diff --git a/chromium_src/chrome/browser/first_run/first_run_dialog.h b/chromium_src/chrome/browser/first_run/first_run_dialog.h index 45202af888f..69e6fef1ba3 100644 --- a/chromium_src/chrome/browser/first_run/first_run_dialog.h +++ b/chromium_src/chrome/browser/first_run/first_run_dialog.h @@ -19,7 +19,6 @@ namespace first_run { // Enable first run dialog on Win also. // Upstream only uses it for macOS/Linux. void ShowFirstRunDialog(Profile* profile); -void ShowFirstRunDialogViews(Profile* profile); } // namespace first_run diff --git a/chromium_src/chrome/browser/ui/views/first_run_dialog.cc b/chromium_src/chrome/browser/ui/views/first_run_dialog.cc index b077c0a5ce4..804cac92370 100644 --- a/chromium_src/chrome/browser/ui/views/first_run_dialog.cc +++ b/chromium_src/chrome/browser/ui/views/first_run_dialog.cc @@ -8,7 +8,6 @@ #include #include "base/bind.h" -#include "base/memory/scoped_refptr.h" #include "base/run_loop.h" #include "brave/grit/brave_generated_resources.h" #include "build/build_config.h" @@ -31,10 +30,6 @@ #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" -#if BUILDFLAG(IS_WIN) -#include "brave/browser/brave_shell_integration.h" -#endif - namespace first_run { void ShowFirstRunDialog(Profile* profile) { @@ -77,7 +72,7 @@ FirstRunDialog::FirstRunDialog(base::RepeatingClosure learn_more_callback, if (report_crashes_) report_crashes_->GetChecked(); - SetTitle(l10n_util::GetStringUTF16(IDS_FIRSTRUN_DIALOG_WINDOW_TITLE_BRAVE)); + SetTitle(l10n_util::GetStringUTF16(IDS_FIRST_RUN_DIALOG_WINDOW_TITLE)); SetButtons(ui::DIALOG_BUTTON_OK); SetExtraView( std::make_unique(l10n_util::GetStringUTF16(IDS_LEARN_MORE))) @@ -122,17 +117,8 @@ void FirstRunDialog::Done() { bool FirstRunDialog::Accept() { GetWidget()->Hide(); - if (make_default_->GetChecked()) { - // shell_integration::SetAsDefaultBrowser() doesn't work on Windows 8+. - // Upstream will use DefaultBrowserWorker when it's available on all OSs. - // See the comments of shell_integration::SetAsDefaultBrowser(). -#if BUILDFLAG(IS_WIN) - base::MakeRefCounted() - ->StartSetAsDefault(base::NullCallback()); -#else + if (make_default_->GetChecked()) shell_integration::SetAsDefaultBrowser(); -#endif - } Done(); return true;