From f4669ba0a5d03e2b38f5e547285255c221797f22 Mon Sep 17 00:00:00 2001 From: Simon Hong Date: Wed, 26 Oct 2022 12:54:30 +0900 Subject: [PATCH 1/2] Introduced enable_pin_shortcut buildflags With this, we can support pin shortcut feature on other platforms. --- app/BUILD.gn | 2 ++ app/brave_generated_resources.grd | 3 ++- app/brave_settings_strings.grdp | 2 +- browser/resources/settings/BUILD.gn | 2 ++ .../getting_started_page/getting_started.html | 2 +- .../settings/getting_started_page/getting_started.ts | 2 +- .../pin_shortcut_page/pin_shortcut_page.html | 2 +- browser/resources/settings/settings.gni | 3 ++- browser/resources/settings/sources.gni | 12 ++++++++++-- browser/shell_integrations/buildflags/BUILD.gn | 12 ++++++++++++ browser/shell_integrations/buildflags/buildflags.gni | 6 ++++++ browser/ui/BUILD.gn | 4 +++- browser/ui/views/brave_first_run_dialog.cc | 12 ++++++++---- browser/ui/views/brave_first_run_dialog.h | 4 ++-- browser/ui/webui/brave_settings_ui.cc | 5 +++-- .../brave_settings_localized_strings_provider.cc | 3 ++- 16 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 browser/shell_integrations/buildflags/BUILD.gn create mode 100644 browser/shell_integrations/buildflags/buildflags.gni diff --git a/app/BUILD.gn b/app/BUILD.gn index 46f2adfc4ee9..65db4527b783 100644 --- a/app/BUILD.gn +++ b/app/BUILD.gn @@ -1,3 +1,4 @@ +import("//brave/browser/shell_integrations/buildflags/buildflags.gni") import("//brave/components/brave_vpn/buildflags/buildflags.gni") import("//brave/components/sidebar/buildflags/buildflags.gni") import("//brave/components/speedreader/common/buildflags.gni") @@ -14,6 +15,7 @@ brave_grit("brave_generated_resources_grit") { "enable_sidebar=$enable_sidebar", "enable_speedreader=$enable_speedreader", "enable_brave_vpn=$enable_brave_vpn", + "enable_pin_shortcut=$enable_pin_shortcut", ] source = "brave_generated_resources.grd" output_dir = "$root_gen_dir/brave" diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index 7af707168531..b9eff6193fec 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -938,11 +938,12 @@ Or change later at $2brave://settings/ext Maybe later - + Pin to taskbar + Microsoft Edge Legacy diff --git a/app/brave_settings_strings.grdp b/app/brave_settings_strings.grdp index 07bca1742821..74613e366167 100644 --- a/app/brave_settings_strings.grdp +++ b/app/brave_settings_strings.grdp @@ -141,7 +141,7 @@ - + Pin to taskbar diff --git a/browser/resources/settings/BUILD.gn b/browser/resources/settings/BUILD.gn index b6bf732c885e..26c36f9e8547 100644 --- a/browser/resources/settings/BUILD.gn +++ b/browser/resources/settings/BUILD.gn @@ -4,6 +4,7 @@ # you can obtain one at http://mozilla.org/MPL/2.0/. import("//brave/browser/resources/settings/sources.gni") +import("//brave/browser/shell_integrations/buildflags/buildflags.gni") import("//brave/build/config.gni") import("//brave/components/brave_vpn/buildflags/buildflags.gni") import("//brave/components/brave_wayback_machine/buildflags/buildflags.gni") @@ -70,6 +71,7 @@ preprocess_if_expr("preprocess") { "enable_brave_wayback_machine=$enable_brave_wayback_machine", "enable_brave_vpn=$enable_brave_vpn", "enable_extensions=$enable_extensions", + "enable_pin_shortcut=$enable_pin_shortcut", ] in_folder = "./" out_folder = diff --git a/browser/resources/settings/getting_started_page/getting_started.html b/browser/resources/settings/getting_started_page/getting_started.html index e7e97afa88b6..a3c5bee557bc 100644 --- a/browser/resources/settings/getting_started_page/getting_started.html +++ b/browser/resources/settings/getting_started_page/getting_started.html @@ -6,7 +6,7 @@
- +
$i18n{onStartup}
diff --git a/browser/resources/settings/getting_started_page/getting_started.ts b/browser/resources/settings/getting_started_page/getting_started.ts index 0c3ee1c2b852..dd6475e55e8e 100644 --- a/browser/resources/settings/getting_started_page/getting_started.ts +++ b/browser/resources/settings/getting_started_page/getting_started.ts @@ -11,7 +11,7 @@ import '../default_browser_page/default_browser_page.js' import '../on_startup_page/on_startup_page.js' import {getTemplate} from './getting_started.html.js' -// +// import '../pin_shortcut_page/pin_shortcut_page.js' // diff --git a/browser/resources/settings/pin_shortcut_page/pin_shortcut_page.html b/browser/resources/settings/pin_shortcut_page/pin_shortcut_page.html index 711641eebed0..c8e3a0424475 100644 --- a/browser/resources/settings/pin_shortcut_page/pin_shortcut_page.html +++ b/browser/resources/settings/pin_shortcut_page/pin_shortcut_page.html @@ -3,7 +3,7 @@ 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/. --> - +