diff --git a/build/BUILD.gn b/build/BUILD.gn index 09194f3ac467..fbf65421778d 100644 --- a/build/BUILD.gn +++ b/build/BUILD.gn @@ -1,22 +1,13 @@ import("//brave/build/config.gni") # Changing these will cause a full rebuild -brave_include_dirs_ = [ - "//brave/chromium_src", -] +brave_include_dirs_ = [ "//brave/chromium_src" ] -if (brave_chromium_build) { - config("compiler") { - include_dirs = brave_include_dirs_ - defines = [ "BRAVE_CHROMIUM_BUILD" ] - } -} else { - config("compiler") {} +config("compiler") { + include_dirs = brave_include_dirs_ } # do not expose this as a public config anywhere config("version") { - defines = [ - "BRAVE_CHROMIUM_VERSION=\"$chrome_version_string\"", - ] + defines = [ "BRAVE_CHROMIUM_VERSION=\"$chrome_version_string\"" ] } diff --git a/build/features.gni b/build/features.gni index dda39e5751ea..308109b4b18d 100644 --- a/build/features.gni +++ b/build/features.gni @@ -1,6 +1,4 @@ declare_args() { - brave_chromium_build = true - brave_services_key = "" } diff --git a/chromium_src/chrome/browser/ui/webui/settings/metrics_reporting_handler.cc b/chromium_src/chrome/browser/ui/webui/settings/metrics_reporting_handler.cc index 6ddc7b98b296..25bb3fd14d33 100644 --- a/chromium_src/chrome/browser/ui/webui/settings/metrics_reporting_handler.cc +++ b/chromium_src/chrome/browser/ui/webui/settings/metrics_reporting_handler.cc @@ -3,12 +3,12 @@ * 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/. */ -#if defined(BRAVE_CHROMIUM_BUILD) -#define GOOGLE_CHROME_BUILD -#endif +#include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/metrics/chrome_metrics_service_accessor.h" +#include "chrome/browser/metrics/metrics_reporting_state.h" +#include "content/public/browser/web_ui.h" +#define GOOGLE_CHROME_BUILD #include "../../../../../../../chrome/browser/ui/webui/settings/metrics_reporting_handler.cc" - -#if defined(BRAVE_CHROMIUM_BUILD) #undef GOOGLE_CHROME_BUILD -#endif diff --git a/chromium_src/chrome/browser/ui/webui/settings/metrics_reporting_handler.h b/chromium_src/chrome/browser/ui/webui/settings/metrics_reporting_handler.h index 3001798c1248..0ceb8bcd635d 100644 --- a/chromium_src/chrome/browser/ui/webui/settings/metrics_reporting_handler.h +++ b/chromium_src/chrome/browser/ui/webui/settings/metrics_reporting_handler.h @@ -6,14 +6,10 @@ #ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_WEBUI_SETTINGS_METRICS_REPORTING_HANDLER_H_ #define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_WEBUI_SETTINGS_METRICS_REPORTING_HANDLER_H_ -#if defined(BRAVE_CHROMIUM_BUILD) -#define GOOGLE_CHROME_BUILD -#endif +#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" +#define GOOGLE_CHROME_BUILD #include "../../../../../../../chrome/browser/ui/webui/settings/metrics_reporting_handler.h" - -#if defined(BRAVE_CHROMIUM_BUILD) #undef GOOGLE_CHROME_BUILD -#endif #endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_WEBUI_SETTINGS_METRICS_REPORTING_HANDLER_H_ diff --git a/common/resource_bundle_helper.cc b/common/resource_bundle_helper.cc index b9feb507f6aa..3f9175afc57b 100644 --- a/common/resource_bundle_helper.cc +++ b/common/resource_bundle_helper.cc @@ -21,13 +21,13 @@ #include "base/strings/sys_string_conversions.h" #endif -#if defined(OS_ANDROID) && defined(BRAVE_CHROMIUM_BUILD) +#if defined(OS_ANDROID) #include "ui/base/resource/resource_bundle_android.h" #endif namespace { -#if !defined(BRAVE_CHROMIUM_BUILD) || !defined(OS_ANDROID) +#if !defined(OS_ANDROID) base::FilePath GetResourcesPakFilePath() { #if defined(OS_MAC) return base::mac::PathForFrameworkBundleResource( @@ -67,7 +67,7 @@ base::FilePath GetScaledResourcesPakFilePath(ui::ScaleFactor scale_factor) { namespace brave { void InitializeResourceBundle() { -#if defined(OS_ANDROID) && defined(BRAVE_CHROMIUM_BUILD) +#if defined(OS_ANDROID) ui::BraveLoadMainAndroidPackFile("assets/brave_resources.pak", base::FilePath()); ui::BraveLoadBrave100PercentPackFile("assets/brave_100_percent.pak", @@ -81,7 +81,7 @@ void InitializeResourceBundle() { rb.AddDataPackFromPath(GetScaledResourcesPakFilePath(ui::SCALE_FACTOR_200P), ui::SCALE_FACTOR_200P); } -#endif // OS_ANDROID && defined(BRAVE_CHROMIUM_BUILD) +#endif // OS_ANDROID } // Returns true if this subprocess type needs the ResourceBundle initialized diff --git a/components/brave_rewards/browser/rewards_service_impl.cc b/components/brave_rewards/browser/rewards_service_impl.cc index 856a671248de..baccb2ec0e9d 100644 --- a/components/brave_rewards/browser/rewards_service_impl.cc +++ b/components/brave_rewards/browser/rewards_service_impl.cc @@ -51,6 +51,7 @@ #include "brave/components/brave_rewards/browser/static_values.h" #include "brave/components/brave_rewards/browser/switches.h" #include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/resources/grit/brave_rewards_resources.h" #include "brave/components/services/bat_ledger/public/cpp/ledger_client_mojo_bridge.h" #include "brave/grit/brave_generated_resources.h" #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h" @@ -61,6 +62,7 @@ #include "components/country_codes/country_codes.h" #include "components/favicon/core/favicon_service.h" #include "components/favicon_base/favicon_types.h" +#include "components/grit/brave_components_resources.h" #include "components/os_crypt/os_crypt.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_task_traits.h" @@ -79,13 +81,6 @@ #include "url/url_canon_stdstring.h" #include "url/url_util.h" -#if defined(BRAVE_CHROMIUM_BUILD) -#include "brave/components/brave_rewards/resources/grit/brave_rewards_resources.h" -#include "components/grit/brave_components_resources.h" -#else -#include "components/grit/components_resources.h" -#endif - #if BUILDFLAG(ENABLE_GREASELION) #include "brave/components/greaselion/browser/greaselion_service.h" #endif diff --git a/patches/chrome-BUILD.gn.patch b/patches/chrome-BUILD.gn.patch index 79e05325a84c..8e61dd092045 100644 --- a/patches/chrome-BUILD.gn.patch +++ b/patches/chrome-BUILD.gn.patch @@ -1,19 +1,16 @@ diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae4220326d3790e2 100644 +index 5eeb0d0c2598bbcff4981dcb6f43cae82ec37c99..1f53a398c9a77af1e08a1e0be2fd3c9d9e147b6d 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -166,6 +166,10 @@ if (!is_android && !is_mac) { +@@ -165,6 +165,7 @@ if (!is_android && !is_mac) { "common/crash_keys.cc", "common/crash_keys.h", ] -+ if (brave_chromium_build) { -+ sources -= [ "app/chrome_exe.rc", ] -+ sources += [ "//brave/app/brave_exe.rc", ] -+ } ++ sources -= [ "app/chrome_exe.rc", ] sources += [ "//brave/app/brave_exe.rc", ] deps += [ ":chrome_dll", -@@ -433,11 +437,12 @@ if (is_win) { +@@ -432,11 +433,12 @@ if (is_win) { args += [ "--keystone=0" ] } } @@ -27,7 +24,7 @@ index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae422032 extra_substitutions = [ "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", "CHROMIUM_SHORT_NAME=$chrome_product_short_name", -@@ -455,6 +460,7 @@ if (is_win) { +@@ -454,6 +456,7 @@ if (is_win) { "//chrome/common:buildflags", "//chrome/common:version_header", ] @@ -35,7 +32,7 @@ index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae422032 if (enable_stripping) { # At link time, preserve the global symbols specified in the .exports -@@ -521,7 +527,7 @@ if (is_win) { +@@ -520,7 +523,7 @@ if (is_win) { args = [ "-b", @@ -44,7 +41,7 @@ index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae422032 "-v", chrome_version_full, "-g", -@@ -590,6 +596,7 @@ if (is_win) { +@@ -589,6 +592,7 @@ if (is_win) { # this dependency directly copies the file into the framework's # resources directory. public_deps += [ ":chrome_framework_widevine_signature" ] @@ -52,7 +49,7 @@ index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae422032 } } -@@ -622,9 +629,11 @@ if (is_win) { +@@ -621,9 +625,11 @@ if (is_win) { "--scm=0", ] } @@ -64,7 +61,7 @@ index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae422032 if (is_chrome_branded) { # These entitlements are bound to the official Google Chrome signing # certificate and will not necessarily work in any other build. -@@ -645,7 +654,7 @@ if (is_win) { +@@ -644,7 +650,7 @@ if (is_win) { output_name = chrome_helper_name + invoker.helper_name_suffix @@ -73,18 +70,15 @@ index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae422032 extra_substitutions = [ "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", "CHROMIUM_SHORT_NAME=$chrome_product_short_name", -@@ -1045,6 +1054,10 @@ if (is_win) { +@@ -1044,6 +1050,7 @@ if (is_win) { if (is_chrome_branded) { deps += [ ":default_apps" ] } -+ if (brave_chromium_build) { -+ deps += [ "//brave:framework_bundle_data" ] -+ if (defined(chrome_framework_version)) { framework_contents += [ "Frameworks", ] } -+ } ++ deps += [ "//brave:framework_bundle_data" ] if (defined(chrome_framework_version)) { framework_contents += [ "Frameworks", ] } ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$chrome_framework_name.framework/Versions/$chrome_version_full/$chrome_framework_name" ] -@@ -1206,6 +1219,7 @@ if (is_win) { +@@ -1205,6 +1212,7 @@ if (is_win) { group("browser_dependencies") { public_deps = [ @@ -92,7 +86,7 @@ index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae422032 "//build:branding_buildflags", "//build:chromeos_buildflags", "//chrome/app:shutdown_signal_handlers", -@@ -1307,12 +1321,13 @@ group("child_dependencies") { +@@ -1306,12 +1314,13 @@ group("child_dependencies") { # this is OK because all of content is linked into one library. "//content/browser", ] @@ -107,7 +101,7 @@ index c28309a07dd643523e4a6d52bf90a9291a521399..d1b1d28c06e095c4c8eeacb9ae422032 output = "$target_gen_dir/chrome_exe_version.rc" } -@@ -1366,6 +1381,7 @@ group("resources") { +@@ -1365,6 +1374,7 @@ group("resources") { "//chrome/browser:resources", "//chrome/common:resources", "//chrome/renderer:resources", diff --git a/patches/chrome-VERSION.patch b/patches/chrome-VERSION.patch index 384be3d650d4..667bec7d8dc2 100644 --- a/patches/chrome-VERSION.patch +++ b/patches/chrome-VERSION.patch @@ -1,5 +1,5 @@ diff --git a/chrome/VERSION b/chrome/VERSION -index 2edc65ac36be89e6be4255a76282ffcaecc71130..59b0547a0bc9c1881b5a472a854c498b4511cc5b 100644 +index 99cbe4cb779807cc3f34a4bb05475279f10d0f49..a3b2d0cb29647f600db54774f5aded6c924c10c6 100644 --- a/chrome/VERSION +++ b/chrome/VERSION @@ -1,4 +1,4 @@ diff --git a/patches/chrome-app-chrome_crash_reporter_client.cc.patch b/patches/chrome-app-chrome_crash_reporter_client.cc.patch index f5ae23eae559..5aacb3945d69 100644 --- a/patches/chrome-app-chrome_crash_reporter_client.cc.patch +++ b/patches/chrome-app-chrome_crash_reporter_client.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/app/chrome_crash_reporter_client.cc b/chrome/app/chrome_crash_reporter_client.cc -index b3a7aebffa224c360e3760f816887cb979999c57..cd8cf6856ae1fa1c28f1274ab2db1299d576e9f1 100644 +index b3a7aebffa224c360e3760f816887cb979999c57..e56f309c199b87d63b32c33effb5e08017224f7f 100644 --- a/chrome/app/chrome_crash_reporter_client.cc +++ b/chrome/app/chrome_crash_reporter_client.cc @@ -154,7 +154,7 @@ bool ChromeCrashReporterClient::IsRunningUnattended() { @@ -7,7 +7,7 @@ index b3a7aebffa224c360e3760f816887cb979999c57..cd8cf6856ae1fa1c28f1274ab2db1299 bool ChromeCrashReporterClient::GetCollectStatsConsent() { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) bool is_official_chrome_build = true; #else bool is_official_chrome_build = false; diff --git a/patches/chrome-app-chrome_dll.rc.patch b/patches/chrome-app-chrome_dll.rc.patch index c6675605d0d9..a718785c7b95 100644 --- a/patches/chrome-app-chrome_dll.rc.patch +++ b/patches/chrome-app-chrome_dll.rc.patch @@ -1,12 +1,11 @@ diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc -index d299571ac031f4b3ff964fbf2dd865ba31bdd0bf..c63a4397ebdd9fae76ba331be26ed4f9dc14dfac 100644 +index d299571ac031f4b3ff964fbf2dd865ba31bdd0bf..06eef7187c1c288d1db668b94ed742d538c6b2bf 100644 --- a/chrome/app/chrome_dll.rc +++ b/chrome/app/chrome_dll.rc -@@ -164,6 +164,16 @@ END +@@ -164,6 +164,15 @@ END // the icon from the current module). We can perhaps work around this in the // future to get the icon from the .exe, which would save a copy. -+#if defined(BRAVE_CHROMIUM_BUILD) +#if defined(OFFICIAL_BUILD) +IDR_MAINFRAME ICON "theme\brave\win\brave.ico" +IDR_SXS ICON "theme\brave\win\brave_canary.ico" @@ -15,11 +14,11 @@ index d299571ac031f4b3ff964fbf2dd865ba31bdd0bf..c63a4397ebdd9fae76ba331be26ed4f9 +#else +IDR_MAINFRAME ICON "theme\brave\win\brave_development.ico" +#endif -+#else ++#if 0 #if BUILDFLAG(GOOGLE_CHROME_BRANDING) IDR_MAINFRAME ICON "theme\google_chrome\win\chrome.ico" IDR_SXS ICON "theme\google_chrome\win\chrome_sxs.ico" -@@ -172,6 +182,7 @@ IDR_X005_BETA ICON "theme\google_chrome\win\chrome_ +@@ -172,6 +181,7 @@ IDR_X005_BETA ICON "theme\google_chrome\win\chrome_ #else IDR_MAINFRAME ICON "theme\chromium\win\chromium.ico" #endif diff --git a/patches/chrome-app-theme-BUILD.gn.patch b/patches/chrome-app-theme-BUILD.gn.patch index 00064f71fa2d..1ef65b02ab5c 100644 --- a/patches/chrome-app-theme-BUILD.gn.patch +++ b/patches/chrome-app-theme-BUILD.gn.patch @@ -1,12 +1,12 @@ diff --git a/chrome/app/theme/BUILD.gn b/chrome/app/theme/BUILD.gn -index 57e8917e359a2fc59f567bd33f9340e400e55b1f..b127c994019d8ba1e5750b33c300c2ec9dcf3463 100644 +index 57e8917e359a2fc59f567bd33f9340e400e55b1f..a4489e2c34d1a02138afb05ccfc72d0129572f3e 100644 --- a/chrome/app/theme/BUILD.gn +++ b/chrome/app/theme/BUILD.gn @@ -21,6 +21,7 @@ grit("theme_resources") { ":chrome_unscaled_resources", "//ui/resources", ] -+ if (brave_chromium_build) { deps += ["//brave/app/theme:brave_theme_resources"]} ++ deps += ["//brave/app/theme:brave_theme_resources"] output_dir = "$root_gen_dir/chrome" } @@ -14,7 +14,7 @@ index 57e8917e359a2fc59f567bd33f9340e400e55b1f..b127c994019d8ba1e5750b33c300c2ec "grit/chrome_unscaled_resources.h", "chrome_unscaled_resources.pak", ] -+ if (brave_chromium_build) { deps = ["//brave/app/theme:brave_unscaled_resources"]} ++ deps = ["//brave/app/theme:brave_unscaled_resources"] output_dir = "$root_gen_dir/chrome" } diff --git a/patches/chrome-browser-first_run-upgrade_util_win.cc.patch b/patches/chrome-browser-first_run-upgrade_util_win.cc.patch index 9061e21c9f77..8f71c0aa746a 100644 --- a/patches/chrome-browser-first_run-upgrade_util_win.cc.patch +++ b/patches/chrome-browser-first_run-upgrade_util_win.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc -index 97cd4d1365eda7480c07c3b52c339515ca3acb40..a39aadfa07a3f1063c1fa3fd9a14ad8d159e2260 100644 +index 97cd4d1365eda7480c07c3b52c339515ca3acb40..3394103ade301445a5996f7cde7d97801a0258dd 100644 --- a/chrome/browser/first_run/upgrade_util_win.cc +++ b/chrome/browser/first_run/upgrade_util_win.cc @@ -41,7 +41,7 @@ @@ -7,7 +7,7 @@ index 97cd4d1365eda7480c07c3b52c339515ca3acb40..a39aadfa07a3f1063c1fa3fd9a14ad8d #include "ui/base/ui_base_switches.h" -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) #include "google_update/google_update_idl.h" #endif @@ -16,7 +16,7 @@ index 97cd4d1365eda7480c07c3b52c339515ca3acb40..a39aadfa07a3f1063c1fa3fd9a14ad8d bool InvokeGoogleUpdateForRename() { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) Microsoft::WRL::ComPtr ipl; HRESULT hr = ::CoCreateInstance(__uuidof(ProcessLauncherClass), nullptr, CLSCTX_ALL, IID_PPV_ARGS(&ipl)); diff --git a/patches/chrome-browser-net-net_error_tab_helper.cc.patch b/patches/chrome-browser-net-net_error_tab_helper.cc.patch index ca7e7120b2d9..6c90e678c56f 100644 --- a/patches/chrome-browser-net-net_error_tab_helper.cc.patch +++ b/patches/chrome-browser-net-net_error_tab_helper.cc.patch @@ -1,14 +1,12 @@ diff --git a/chrome/browser/net/net_error_tab_helper.cc b/chrome/browser/net/net_error_tab_helper.cc -index 313758372e0fcb842ee6a5b5cd69a64b8a95b2ac..cc920fb9459462075a1a9c123ae7af34ea5c8ac8 100644 +index 313758372e0fcb842ee6a5b5cd69a64b8a95b2ac..bc8c3c243dd2f05b5fa9708d1d72bfa9f6dffcc0 100644 --- a/chrome/browser/net/net_error_tab_helper.cc +++ b/chrome/browser/net/net_error_tab_helper.cc -@@ -200,6 +200,9 @@ void NetErrorTabHelper::InitializePref(WebContents* contents) { +@@ -200,6 +200,7 @@ void NetErrorTabHelper::InitializePref(WebContents* contents) { } bool NetErrorTabHelper::ProbesAllowed() const { -+#if defined(BRAVE_CHROMIUM_BUILD) + return false; -+#endif if (testing_state_ != TESTING_DEFAULT) return testing_state_ == TESTING_FORCE_ENABLED; diff --git a/patches/chrome-browser-profiles-profile_io_data.cc.patch b/patches/chrome-browser-profiles-profile_io_data.cc.patch index bf346412e88a..a2792530f73a 100644 --- a/patches/chrome-browser-profiles-profile_io_data.cc.patch +++ b/patches/chrome-browser-profiles-profile_io_data.cc.patch @@ -1,14 +1,12 @@ diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc -index 2f5ed4b15589ffa5bae18d7f06e6776f705f5229..62b9d86de52131eac490aeb41b55a057f4d9373e 100644 +index 2f5ed4b15589ffa5bae18d7f06e6776f705f5229..a4bd6ab7ef01d4740211eff1de086fe1493f2129 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc -@@ -248,6 +248,9 @@ bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { +@@ -248,6 +248,7 @@ bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { #endif content::kChromeUIScheme, content::kChromeUIUntrustedScheme, -+#if defined(BRAVE_CHROMIUM_BUILD) + kBraveUIScheme, -+#endif url::kDataScheme, #if BUILDFLAG(IS_CHROMEOS_ASH) content::kExternalFileScheme, diff --git a/patches/chrome-browser-ui-startup-startup_tab_provider.cc.patch b/patches/chrome-browser-ui-startup-startup_tab_provider.cc.patch index 7769f9d88919..95337f368734 100644 --- a/patches/chrome-browser-ui-startup-startup_tab_provider.cc.patch +++ b/patches/chrome-browser-ui-startup-startup_tab_provider.cc.patch @@ -1,16 +1,12 @@ diff --git a/chrome/browser/ui/startup/startup_tab_provider.cc b/chrome/browser/ui/startup/startup_tab_provider.cc -index b16e6b9deb6c951007ab6932f028982ca7c74671..b453e5b069bd4721e1ee857e71843b0a5494b2db 100644 +index b16e6b9deb6c951007ab6932f028982ca7c74671..833666f7469189cb319ea7f1a5fb00ce182972d0 100644 --- a/chrome/browser/ui/startup/startup_tab_provider.cc +++ b/chrome/browser/ui/startup/startup_tab_provider.cc -@@ -144,7 +144,11 @@ StartupTabs StartupTabProviderImpl::GetExtensionCheckupTabs( +@@ -144,6 +144,7 @@ StartupTabs StartupTabProviderImpl::GetExtensionCheckupTabs( bool StartupTabProviderImpl::CanShowWelcome(bool is_signin_allowed, bool is_supervised_user, bool is_force_signin_enabled) { -+#if defined(BRAVE_CHROMIUM_BUILD) + return true; -+#else return is_signin_allowed && !is_supervised_user && !is_force_signin_enabled; -+#endif } - // static diff --git a/patches/chrome-browser-ui-views-outdated_upgrade_bubble_view.cc.patch b/patches/chrome-browser-ui-views-outdated_upgrade_bubble_view.cc.patch index 3b0e9a6007a4..fde57ab48581 100644 --- a/patches/chrome-browser-ui-views-outdated_upgrade_bubble_view.cc.patch +++ b/patches/chrome-browser-ui-views-outdated_upgrade_bubble_view.cc.patch @@ -1,14 +1,13 @@ diff --git a/chrome/browser/ui/views/outdated_upgrade_bubble_view.cc b/chrome/browser/ui/views/outdated_upgrade_bubble_view.cc -index 884c739a0cf60db19aba93b418f32949cfa1bc78..351b0017c209343f9694b8db9a00c500dee1f743 100644 +index 884c739a0cf60db19aba93b418f32949cfa1bc78..00cf052f0ec66db43aeec72ebd869359e2dd3b29 100644 --- a/chrome/browser/ui/views/outdated_upgrade_bubble_view.cc +++ b/chrome/browser/ui/views/outdated_upgrade_bubble_view.cc -@@ -37,8 +37,12 @@ namespace { +@@ -37,8 +37,11 @@ namespace { // The URL to be used to re-install Chrome when auto-update failed for too long. constexpr char kDownloadChromeUrl[] = -+#if defined(BRAVE_CHROMIUM_BUILD) + kDownloadBraveUrl; -+#else ++#if 0 "https://www.google.com/chrome/?&brand=CHWL" "&utm_campaign=en&utm_source=en-et-na-us-chrome-bubble&utm_medium=et"; +#endif diff --git a/patches/chrome-browser-ui-webui-theme_source.cc.patch b/patches/chrome-browser-ui-webui-theme_source.cc.patch index 1b895294f1f9..0b3f87b2eafb 100644 --- a/patches/chrome-browser-ui-webui-theme_source.cc.patch +++ b/patches/chrome-browser-ui-webui-theme_source.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/ui/webui/theme_source.cc b/chrome/browser/ui/webui/theme_source.cc -index 1386ed6ae3bf50f616bca5945295b2cd7f4fd954..d33786aae1a9df062ac4453817027cd6257c3b7d 100644 +index 1386ed6ae3bf50f616bca5945295b2cd7f4fd954..1fd84e8da34fad21557277ceb014548c03242d5d 100644 --- a/chrome/browser/ui/webui/theme_source.cc +++ b/chrome/browser/ui/webui/theme_source.cc @@ -100,7 +100,7 @@ void ThemeSource::StartDataRequest( @@ -7,17 +7,16 @@ index 1386ed6ae3bf50f616bca5945295b2cd7f4fd954..d33786aae1a9df062ac4453817027cd6 if (parsed_path == "current-channel-logo") { switch (chrome::GetChannel()) { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) case version_info::Channel::CANARY: resource_id = IDR_PRODUCT_LOGO_32_CANARY; break; -@@ -122,7 +122,11 @@ void ThemeSource::StartDataRequest( +@@ -122,7 +122,10 @@ void ThemeSource::StartDataRequest( FALLTHROUGH; #endif case version_info::Channel::UNKNOWN: -+#if defined(BRAVE_CHROMIUM_BUILD) + resource_id = IDR_PRODUCT_LOGO_32_DEVELOPMENT; -+#else ++#if 0 resource_id = IDR_PRODUCT_LOGO_32; +#endif break; diff --git a/patches/chrome-browser-upgrade_detector-upgrade_detector_impl.cc.patch b/patches/chrome-browser-upgrade_detector-upgrade_detector_impl.cc.patch index 2b6818120232..d14266d48cb6 100644 --- a/patches/chrome-browser-upgrade_detector-upgrade_detector_impl.cc.patch +++ b/patches/chrome-browser-upgrade_detector-upgrade_detector_impl.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc -index 4c0d5fed0d792f3339c84a44541508a105628b13..a0650041d5729a83e863b331fc34cf39bd945df9 100644 +index 4c0d5fed0d792f3339c84a44541508a105628b13..b22565422f7f856da47aea3ff0c3d00a1daeda28 100644 --- a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc +++ b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc @@ -457,7 +457,7 @@ void UpgradeDetectorImpl::Init() { @@ -7,7 +7,7 @@ index 4c0d5fed0d792f3339c84a44541508a105628b13..a0650041d5729a83e863b331fc34cf39 // Chromium does not use an auto-updater. #if !defined(OS_WIN) || BUILDFLAG(GOOGLE_CHROME_BRANDING) || \ - BUILDFLAG(ENABLE_CHROMIUM_UPDATER) -+ BUILDFLAG(ENABLE_CHROMIUM_UPDATER) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++ BUILDFLAG(ENABLE_CHROMIUM_UPDATER) || defined(OFFICIAL_BUILD) // On macOS, only enable upgrade notifications if the updater (Keystone) is // present. diff --git a/patches/chrome-chrome_proxy-chrome_proxy_main_win.cc.patch b/patches/chrome-chrome_proxy-chrome_proxy_main_win.cc.patch index b6f8428054bd..24f24d19f536 100644 --- a/patches/chrome-chrome_proxy-chrome_proxy_main_win.cc.patch +++ b/patches/chrome-chrome_proxy-chrome_proxy_main_win.cc.patch @@ -1,14 +1,13 @@ diff --git a/chrome/chrome_proxy/chrome_proxy_main_win.cc b/chrome/chrome_proxy/chrome_proxy_main_win.cc -index 6d79dd32ff183ce06a556b3e7ec60bd53ff4f917..2b316dd01dea0ed2b6703f037745da54645e3950 100644 +index 6d79dd32ff183ce06a556b3e7ec60bd53ff4f917..6cb9d7083d893677f11c1df8b501823e0638b6e6 100644 --- a/chrome/chrome_proxy/chrome_proxy_main_win.cc +++ b/chrome/chrome_proxy/chrome_proxy_main_win.cc -@@ -13,7 +13,11 @@ +@@ -13,7 +13,10 @@ namespace { constexpr base::FilePath::CharType kChromeExecutable[] = -+#if defined(BRAVE_CHROMIUM_BUILD) + FILE_PATH_LITERAL("brave.exe"); -+#else ++#if 0 FILE_PATH_LITERAL("chrome.exe"); +#endif diff --git a/patches/chrome-common-BUILD.gn.patch b/patches/chrome-common-BUILD.gn.patch index eb5cc547e620..bb72e4a2695a 100644 --- a/patches/chrome-common-BUILD.gn.patch +++ b/patches/chrome-common-BUILD.gn.patch @@ -1,12 +1,12 @@ diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn -index 737d5ea55058d068a8cec6dd0d198b04c7807cac..04eb29d07cbb6a9a37c15668f6d6b961e6a4b781 100644 +index 737d5ea55058d068a8cec6dd0d198b04c7807cac..4626cfc06c5949d5b35fe3802f3cf5554868bb3e 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn @@ -65,6 +65,7 @@ source_set("channel_info") { "//build:branding_buildflags", "//build:chromeos_buildflags", ] -+ if (brave_chromium_build) { deps += [ "//brave/common:channel_info" ] } ++ deps += [ "//brave/common:channel_info" ] public_deps = [ "//base", "//components/version_info", @@ -22,7 +22,7 @@ index 737d5ea55058d068a8cec6dd0d198b04c7807cac..04eb29d07cbb6a9a37c15668f6d6b961 "//printing/buildflags", "//ui/base:buildflags", ] -+ if (brave_chromium_build) { configs += [ "//brave/common:constants_configs" ] } ++ configs += [ "//brave/common:constants_configs" ] } component("chrome_features") { diff --git a/patches/chrome-common-channel_info_win.cc.patch b/patches/chrome-common-channel_info_win.cc.patch index f85c7ab62de2..4561c5656099 100644 --- a/patches/chrome-common-channel_info_win.cc.patch +++ b/patches/chrome-common-channel_info_win.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/common/channel_info_win.cc b/chrome/common/channel_info_win.cc -index 8a9e2d3335b6cf945864a88d1644e1935234990b..cae0e9f8f7e1d9dc3d2489111cbb8f5d75330928 100644 +index 8a9e2d3335b6cf945864a88d1644e1935234990b..f442eabe6ecad373f11eb84eb91fcd2ae5dfc538 100644 --- a/chrome/common/channel_info_win.cc +++ b/chrome/common/channel_info_win.cc @@ -13,7 +13,7 @@ @@ -7,7 +7,7 @@ index 8a9e2d3335b6cf945864a88d1644e1935234990b..cae0e9f8f7e1d9dc3d2489111cbb8f5d std::string GetChannelName() { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) base::string16 channel(install_static::GetChromeChannelName()); #if defined(DCHECK_IS_CONFIGURABLE) // Adorn the channel when DCHECKs are baked into the build, as there will be diff --git a/patches/chrome-common-chrome_content_client_constants.cc.patch b/patches/chrome-common-chrome_content_client_constants.cc.patch index 2dbacbec7ede..8878b74b879e 100644 --- a/patches/chrome-common-chrome_content_client_constants.cc.patch +++ b/patches/chrome-common-chrome_content_client_constants.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/common/chrome_content_client_constants.cc b/chrome/common/chrome_content_client_constants.cc -index a8365688d3ea165e26bc6a9e1b1851cbacaf59b2..17ef13b5c02ee59769509e00b6d40945092baed8 100644 +index a8365688d3ea165e26bc6a9e1b1851cbacaf59b2..659229e8b0774574393d4212af9a42a98ed657f2 100644 --- a/chrome/common/chrome_content_client_constants.cc +++ b/chrome/common/chrome_content_client_constants.cc @@ -14,7 +14,7 @@ const base::FilePath::CharType ChromeContentClient::kNaClPluginFileName[] = @@ -7,7 +7,7 @@ index a8365688d3ea165e26bc6a9e1b1851cbacaf59b2..17ef13b5c02ee59769509e00b6d40945 #endif -#if defined(GOOGLE_CHROME_BUILD) -+#if defined(GOOGLE_CHROME_BUILD) || defined(BRAVE_CHROMIUM_BUILD) ++#if 1 // Always enabled for Brave's Chromium build const char ChromeContentClient::kPDFExtensionPluginName[] = "Chrome PDF Viewer"; const char ChromeContentClient::kPDFInternalPluginName[] = "Chrome PDF Plugin"; #else diff --git a/patches/chrome-install_static-install_modes.cc.patch b/patches/chrome-install_static-install_modes.cc.patch index 42b4035d68f3..e489d0dcf8bd 100644 --- a/patches/chrome-install_static-install_modes.cc.patch +++ b/patches/chrome-install_static-install_modes.cc.patch @@ -1,18 +1,17 @@ diff --git a/chrome/install_static/install_modes.cc b/chrome/install_static/install_modes.cc -index b8195c5e6b5030dbcee06389284cc3e3a82f116e..08ed31808e33c7d644c3cd2668404c5277bdfc07 100644 +index b8195c5e6b5030dbcee06389284cc3e3a82f116e..0e49aa7f242f2ecbe87263bbeb2728b3e69c27e6 100644 --- a/chrome/install_static/install_modes.cc +++ b/chrome/install_static/install_modes.cc -@@ -11,6 +11,9 @@ namespace install_static { +@@ -11,6 +11,8 @@ namespace install_static { namespace { #if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION) -+#if defined(BRAVE_CHROMIUM_BUILD) + BRAVE_INSTALL_MODES -+#else ++#if 0 std::wstring GetClientsKeyPathForApp(const wchar_t* app_guid) { return std::wstring(L"Software\\Google\\Update\\Clients\\").append(app_guid); } -@@ -24,6 +27,7 @@ std::wstring GetClientStateMediumKeyPathForApp(const wchar_t* app_guid) { +@@ -24,6 +26,7 @@ std::wstring GetClientStateMediumKeyPathForApp(const wchar_t* app_guid) { return std::wstring(L"Software\\Google\\Update\\ClientStateMedium\\") .append(app_guid); } diff --git a/patches/chrome-install_static-install_util.cc.patch b/patches/chrome-install_static-install_util.cc.patch index c11028b5b742..7f2b97838ab1 100644 --- a/patches/chrome-install_static-install_util.cc.patch +++ b/patches/chrome-install_static-install_util.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/install_static/install_util.cc b/chrome/install_static/install_util.cc -index 21053b379f091a4683a4a69b22b545c385ac3c55..fe0f568cb6d2205b6e00650afed2c1d724c54ab7 100644 +index 21053b379f091a4683a4a69b22b545c385ac3c55..2fe7c00611d3ea7b2f755a28334e574439f4d60f 100644 --- a/chrome/install_static/install_util.cc +++ b/chrome/install_static/install_util.cc @@ -688,7 +688,7 @@ void GetExecutableVersionDetails(const std::wstring& exe_path, @@ -7,7 +7,7 @@ index 21053b379f091a4683a4a69b22b545c385ac3c55..fe0f568cb6d2205b6e00650afed2c1d7 version_info::Channel GetChromeChannel() { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) std::wstring channel_name(GetChromeChannelName()); if (channel_name.empty()) { return version_info::Channel::STABLE; diff --git a/patches/chrome-installer-gcapi-gcapi.cc.patch b/patches/chrome-installer-gcapi-gcapi.cc.patch index 3f058a68c9b0..b45aed77fb5e 100644 --- a/patches/chrome-installer-gcapi-gcapi.cc.patch +++ b/patches/chrome-installer-gcapi-gcapi.cc.patch @@ -1,12 +1,12 @@ diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc -index e502b40a78791c65cee30ff0e1ef041eb011d9b2..2652057e4190bf0c1a2b60aced7dce2cb4221879 100644 +index e502b40a78791c65cee30ff0e1ef041eb011d9b2..e6d099259af45174a9d9a0e1011f7ea76a4a105f 100644 --- a/chrome/installer/gcapi/gcapi.cc +++ b/chrome/installer/gcapi/gcapi.cc @@ -57,6 +57,16 @@ using Microsoft::WRL::ComPtr; namespace { -+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) ++#if defined(OFFICIAL_BUILD) +const wchar_t kGCAPITempKey[] = L"Software\\BraveSoftware\\GCAPITemp"; +const wchar_t kChromeRegVersion[] = L"pv"; +const wchar_t kNoChromeOfferUntil[] = diff --git a/patches/chrome-installer-gcapi-google_update_util.cc.patch b/patches/chrome-installer-gcapi-google_update_util.cc.patch index 0f7b9eae4e59..ed04183c07df 100644 --- a/patches/chrome-installer-gcapi-google_update_util.cc.patch +++ b/patches/chrome-installer-gcapi-google_update_util.cc.patch @@ -1,12 +1,12 @@ diff --git a/chrome/installer/gcapi/google_update_util.cc b/chrome/installer/gcapi/google_update_util.cc -index 53a42d799992b4530c8a78513350cf501bcd0e97..532518d3c69dc2a5356a753457de5789566a3c37 100644 +index 53a42d799992b4530c8a78513350cf501bcd0e97..ca86637e93e635c6e251e3e24a5e13731aec0eca 100644 --- a/chrome/installer/gcapi/google_update_util.cc +++ b/chrome/installer/gcapi/google_update_util.cc @@ -11,6 +11,17 @@ namespace gcapi_internals { -+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) ++#if defined(OFFICIAL_BUILD) +const wchar_t kChromeRegClientsKey[] = + L"Software\\BraveSoftware\\Update\\Clients\\" + L"{AFE6A462-C574-4B8A-AF43-4CC60DF4563B}"; diff --git a/patches/chrome-installer-launcher_support-chrome_launcher_support.cc.patch b/patches/chrome-installer-launcher_support-chrome_launcher_support.cc.patch index 7f9efca2f204..b7e80c9f5245 100644 --- a/patches/chrome-installer-launcher_support-chrome_launcher_support.cc.patch +++ b/patches/chrome-installer-launcher_support-chrome_launcher_support.cc.patch @@ -1,12 +1,12 @@ diff --git a/chrome/installer/launcher_support/chrome_launcher_support.cc b/chrome/installer/launcher_support/chrome_launcher_support.cc -index 36afdc96da27a8fa5e3d1ed798b89edd845b3107..a171f22c0c2bfc3655193c99a2081bdcd98d9292 100644 +index 36afdc96da27a8fa5e3d1ed798b89edd845b3107..0f0b9fae49dd19aac9f00ddb8389da3094f8d766 100644 --- a/chrome/installer/launcher_support/chrome_launcher_support.cc +++ b/chrome/installer/launcher_support/chrome_launcher_support.cc -@@ -26,12 +26,23 @@ const wchar_t kUpdateClientsRegKey[] = L"Software\\Google\\Update\\Clients"; +@@ -26,12 +26,22 @@ const wchar_t kUpdateClientsRegKey[] = L"Software\\Google\\Update\\Clients"; // Copied from google_chrome_install_modes.cc. const wchar_t kBrowserAppGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; const wchar_t kSxSBrowserAppGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; -+#elif defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) ++#elif defined(OFFICIAL_BUILD) +const wchar_t kInstallationRegKey[] = + L"Software\\BraveSoftware\\Update\\ClientState"; +// Copied from @@ -18,29 +18,28 @@ index 36afdc96da27a8fa5e3d1ed798b89edd845b3107..a171f22c0c2bfc3655193c99a2081bdc #endif // Copied from util_constants.cc. -+#if defined(BRAVE_CHROMIUM_BUILD) +const wchar_t kChromeExe[] = L"brave.exe"; -+#else ++#if 0 const wchar_t kChromeExe[] = L"chrome.exe"; +#endif const wchar_t kUninstallStringField[] = L"UninstallString"; const wchar_t kVersionStringField[] = L"pv"; -@@ -95,7 +106,7 @@ base::FilePath GetSetupExeFromRegistry(InstallationLevel level, +@@ -95,7 +105,7 @@ base::FilePath GetSetupExeFromRegistry(InstallationLevel level, // Returns the path to an existing setup.exe at the specified level, if it can // be found via the registry. base::FilePath GetSetupExeForInstallationLevel(InstallationLevel level) { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) // Look in the registry for Chrome. return GetSetupExeFromRegistry(level, kBrowserAppGuid); #else -@@ -131,7 +142,7 @@ base::FilePath FindExeRelativeToSetupExe(const base::FilePath setup_exe_path, +@@ -131,7 +141,7 @@ base::FilePath FindExeRelativeToSetupExe(const base::FilePath setup_exe_path, base::FilePath GetChromePathForInstallationLevel(InstallationLevel level, bool is_sxs) { if (is_sxs) { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) return FindExeRelativeToSetupExe( GetSetupExeFromRegistry(level, kSxSBrowserAppGuid), kChromeExe); #else diff --git a/patches/chrome-installer-mini_installer-configuration.cc.patch b/patches/chrome-installer-mini_installer-configuration.cc.patch index ab4678d11555..6cda11e0d553 100644 --- a/patches/chrome-installer-mini_installer-configuration.cc.patch +++ b/patches/chrome-installer-mini_installer-configuration.cc.patch @@ -1,12 +1,12 @@ diff --git a/chrome/installer/mini_installer/configuration.cc b/chrome/installer/mini_installer/configuration.cc -index 0626baa25d07770e6643b1078bf53889f7f67947..34a8fea6196da767fc25b8254d407f1ad5604330 100644 +index 0626baa25d07770e6643b1078bf53889f7f67947..5deba756a23909912f4c20987803b31ff62e0a5d 100644 --- a/chrome/installer/mini_installer/configuration.cc +++ b/chrome/installer/mini_installer/configuration.cc @@ -24,7 +24,11 @@ namespace { bool GetGoogleUpdateIsMachineEnvVar() { const DWORD kBufferSize = 2; StackString value; -+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) ++#if defined(OFFICIAL_BUILD) + DWORD length = ::GetEnvironmentVariableW(L"BraveSoftwareUpdateIsMachine", +#else DWORD length = ::GetEnvironmentVariableW(L"GoogleUpdateIsMachine", @@ -19,7 +19,7 @@ index 0626baa25d07770e6643b1078bf53889f7f67947..34a8fea6196da767fc25b8254d407f1a if (0 == ::lstrcmpi(args_[i], L"--system-level")) is_system_level_ = true; -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) + // Use original install switch because it isn't visible to user. + // Sync this switch with brave/.../chromium_install_modes.cc else if (0 == ::lstrcmpi(args_[i], L"--chrome-beta")) diff --git a/patches/chrome-installer-mini_installer-regkey.cc.patch b/patches/chrome-installer-mini_installer-regkey.cc.patch index 70a67cf7a36a..603cf6ca3fbe 100644 --- a/patches/chrome-installer-mini_installer-regkey.cc.patch +++ b/patches/chrome-installer-mini_installer-regkey.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/installer/mini_installer/regkey.cc b/chrome/installer/mini_installer/regkey.cc -index ab0f8ab7acc306556add738c97f31a70bc2724d1..39ea0b50fbea4437ccf7d27f23583554d16a738b 100644 +index ab0f8ab7acc306556add738c97f31a70bc2724d1..afdcc4b54d560a258400a5c3aea963ed954b7570 100644 --- a/chrome/installer/mini_installer/regkey.cc +++ b/chrome/installer/mini_installer/regkey.cc @@ -89,7 +89,7 @@ LONG OpenClientsKey(HKEY root_key, @@ -7,7 +7,7 @@ index ab0f8ab7acc306556add738c97f31a70bc2724d1..39ea0b50fbea4437ccf7d27f23583554 if (!clients_key.assign(kClientsKeyBase)) return ERROR_BUFFER_OVERFLOW; -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) if (!clients_key.append(app_guid)) return ERROR_BUFFER_OVERFLOW; #endif @@ -16,7 +16,7 @@ index ab0f8ab7acc306556add738c97f31a70bc2724d1..39ea0b50fbea4437ccf7d27f23583554 if (!client_state_key.assign(kClientStateKeyBase)) return ERROR_BUFFER_OVERFLOW; -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) ++#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(OFFICIAL_BUILD) if (!client_state_key.append(app_guid)) return ERROR_BUFFER_OVERFLOW; #endif diff --git a/patches/chrome-installer-util-BUILD.gn.patch b/patches/chrome-installer-util-BUILD.gn.patch index ef6732c9238a..f7fd7bff61f6 100644 --- a/patches/chrome-installer-util-BUILD.gn.patch +++ b/patches/chrome-installer-util-BUILD.gn.patch @@ -1,24 +1,22 @@ diff --git a/chrome/installer/util/BUILD.gn b/chrome/installer/util/BUILD.gn -index 2ea95551d977717045804377090c4e57bb4e0518..cf2c6401223c15a684e07d274c8466b87c199ea0 100644 +index 2ea95551d977717045804377090c4e57bb4e0518..c3af7ec8bad26ee56ee5b2a786c1c8ece82f6e7b 100644 --- a/chrome/installer/util/BUILD.gn +++ b/chrome/installer/util/BUILD.gn -@@ -225,7 +225,20 @@ generate_embedded_i18n("generate_strings") { +@@ -225,7 +225,18 @@ generate_embedded_i18n("generate_strings") { output_file_name_base = "installer_util_strings" - branding = branding_path_component + brand = "$branding_path_component" -+ if (brave_chromium_build) { -+ # When brave_strings.grd is modified, outputs should be re-generated. -+ # This is workaround. Need to change the way of using |brave_strings.grd| -+ # in |create_string_rc.py|. -+ sources = [ -+ "//chrome/app/brave_strings.grd" -+ ] -+ if (!is_official_build) { -+ # TODO(shong): Remove this. -+ brand = brand + "-development" -+ } ++ # When brave_strings.grd is modified, outputs should be re-generated. ++ # This is workaround. Need to change the way of using |brave_strings.grd| ++ # in |create_string_rc.py|. ++ sources = [ ++ "//chrome/app/brave_strings.grd" ++ ] ++ if (!is_official_build) { ++ # TODO(shong): Remove this. ++ brand = brand + "-development" + } + branding = brand } diff --git a/patches/chrome-installer-util-google_update_constants.cc.patch b/patches/chrome-installer-util-google_update_constants.cc.patch index c5ef16f4c8b2..b62f6405713e 100644 --- a/patches/chrome-installer-util-google_update_constants.cc.patch +++ b/patches/chrome-installer-util-google_update_constants.cc.patch @@ -1,12 +1,11 @@ diff --git a/chrome/installer/util/google_update_constants.cc b/chrome/installer/util/google_update_constants.cc -index 1e5ee12e466ef613d0481e437bd2fd26cbd0ad16..f99d507146e0727feb778ae131f3b11ccf5801aa 100644 +index 1e5ee12e466ef613d0481e437bd2fd26cbd0ad16..eeae3bcce42193d6a24a207cbf346a95af32860f 100644 --- a/chrome/installer/util/google_update_constants.cc +++ b/chrome/installer/util/google_update_constants.cc -@@ -6,6 +6,17 @@ +@@ -6,6 +6,16 @@ namespace google_update { -+#if defined(BRAVE_CHROMIUM_BUILD) +const wchar_t kChromeUpgradeCode[] = L"{AFE6A462-C574-4B8A-AF43-4CC60DF4563B}"; +const wchar_t kGoogleUpdateUpgradeCode[] = + L"{B131C935-9BE6-41DA-9599-1F776BEB8019}"; @@ -16,11 +15,11 @@ index 1e5ee12e466ef613d0481e437bd2fd26cbd0ad16..f99d507146e0727feb778ae131f3b11c +const wchar_t kRegPathClientStateMedium[] = + L"Software\\BraveSoftware\\Update\\ClientStateMedium"; +const wchar_t kRegPathGoogleUpdate[] = L"Software\\BraveSoftware\\Update"; -+#else ++#if 0 const wchar_t kChromeUpgradeCode[] = L"{8A69D345-D564-463C-AFF1-A69D9E530F96}"; const wchar_t kGoogleUpdateUpgradeCode[] = -@@ -18,6 +29,7 @@ const wchar_t kRegPathClientState[] = L"Software\\Google\\Update\\ClientState"; +@@ -18,6 +28,7 @@ const wchar_t kRegPathClientState[] = L"Software\\Google\\Update\\ClientState"; const wchar_t kRegPathClientStateMedium[] = L"Software\\Google\\Update\\ClientStateMedium"; const wchar_t kRegPathGoogleUpdate[] = L"Software\\Google\\Update"; diff --git a/patches/chrome-installer-util-google_update_settings.cc.patch b/patches/chrome-installer-util-google_update_settings.cc.patch index 5ab97a3d9009..3ba433f4eeeb 100644 --- a/patches/chrome-installer-util-google_update_settings.cc.patch +++ b/patches/chrome-installer-util-google_update_settings.cc.patch @@ -1,12 +1,12 @@ diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc -index c67b11cc6f53fe3493e483b993da717a71db37e3..d9f91fa63cd38504435c5ad4f7e7d64638423cf2 100644 +index c67b11cc6f53fe3493e483b993da717a71db37e3..44d8d6cf55bb2f22b2820228179f726240414d05 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -30,7 +30,11 @@ using base::win::RegKey; using installer::InstallationState; const wchar_t GoogleUpdateSettings::kPoliciesKey[] = -+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) ++#if defined(OFFICIAL_BUILD) + L"SOFTWARE\\Policies\\BraveSoftware\\Update"; +#else L"SOFTWARE\\Policies\\Google\\Update"; @@ -18,7 +18,7 @@ index c67b11cc6f53fe3493e483b993da717a71db37e3..d9f91fa63cd38504435c5ad4f7e7d646 const int GoogleUpdateSettings::kCheckPeriodOverrideMinutesMax = 60 * 24 * 7 * 6; -+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) ++#if defined(OFFICIAL_BUILD) +#undef BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING +#define BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING() (1) +#endif diff --git a/patches/chrome-installer-util-util_constants.cc.patch b/patches/chrome-installer-util-util_constants.cc.patch index 18a86b8a19cf..0b2ddc0be60d 100644 --- a/patches/chrome-installer-util-util_constants.cc.patch +++ b/patches/chrome-installer-util-util_constants.cc.patch @@ -1,12 +1,12 @@ diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc -index 77b5f3f11edc90875a8ee6cbf53f6c0909223c73..fa66387ad755a57fbc4eb23fb5016dd36061400d 100644 +index 77b5f3f11edc90875a8ee6cbf53f6c0909223c73..8a017c2bb7510ff5c115f82c6013c42ab39702cc 100644 --- a/chrome/installer/util/util_constants.cc +++ b/chrome/installer/util/util_constants.cc @@ -182,7 +182,13 @@ namespace env_vars { // The presence of this environment variable with a value of 1 implies that // setup.exe should run as a system installation regardless of what is on the // command line. -+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) ++#if defined(OFFICIAL_BUILD) +// Reflect brave branded-omaha variable name. +// Company name(BraveSoftware) + Product name(Update). +const char kGoogleUpdateIsMachineEnvVar[] = "BraveSoftwareUpdateIsMachine"; @@ -16,13 +16,12 @@ index 77b5f3f11edc90875a8ee6cbf53f6c0909223c73..fa66387ad755a57fbc4eb23fb5016dd3 } // namespace env_vars -@@ -197,7 +203,11 @@ const char kGoogleUpdateIsMachineEnvVar[] = "GoogleUpdateIsMachine"; +@@ -197,7 +203,10 @@ const char kGoogleUpdateIsMachineEnvVar[] = "GoogleUpdateIsMachine"; // Active Setup. const wchar_t kActiveSetupExe[] = L"chrmstp.exe"; const wchar_t kChromeDll[] = L"chrome.dll"; -+#if defined(BRAVE_CHROMIUM_BUILD) +const wchar_t kChromeExe[] = L"brave.exe"; -+#else ++#if 0 const wchar_t kChromeExe[] = L"chrome.exe"; +#endif const wchar_t kChromeNewExe[] = L"new_chrome.exe"; diff --git a/patches/components-password_manager-core-browser-password_form_filling.cc.patch b/patches/components-password_manager-core-browser-password_form_filling.cc.patch index d8f1ef2c0a04..b501ad326310 100644 --- a/patches/components-password_manager-core-browser-password_form_filling.cc.patch +++ b/patches/components-password_manager-core-browser-password_form_filling.cc.patch @@ -1,14 +1,12 @@ diff --git a/components/password_manager/core/browser/password_form_filling.cc b/components/password_manager/core/browser/password_form_filling.cc -index a3237754374bad111ac0dced25c9018718c8a2cb..56c303c4a72045c3e294166d8b3fdd09e7ca3bac 100644 +index a3237754374bad111ac0dced25c9018718c8a2cb..6d39bca91588768bcd406efddea1d0a457bd7cf4 100644 --- a/components/password_manager/core/browser/password_form_filling.cc +++ b/components/password_manager/core/browser/password_form_filling.cc -@@ -215,6 +215,9 @@ LikelyFormFilling SendFillInformationToRenderer( +@@ -215,6 +215,7 @@ LikelyFormFilling SendFillInformationToRenderer( bool wait_for_username = wait_for_username_reason != WaitForUsernameReason::kDontWait; -+#if defined(BRAVE_CHROMIUM_BUILD) + wait_for_username = true; -+#endif if (wait_for_username) { metrics_recorder->SetManagerAction( diff --git a/patches/components-update_client-updater_state_win.cc.patch b/patches/components-update_client-updater_state_win.cc.patch index cf0455a75f47..963435e9547b 100644 --- a/patches/components-update_client-updater_state_win.cc.patch +++ b/patches/components-update_client-updater_state_win.cc.patch @@ -1,22 +1,20 @@ diff --git a/components/update_client/updater_state_win.cc b/components/update_client/updater_state_win.cc -index 89c2c186f9c095d6c2a9210ca2c4e8a94ee64b98..9f7ba1eb42bb50d21cdc2a905dd45e5d5bf7d82c 100644 +index 89c2c186f9c095d6c2a9210ca2c4e8a94ee64b98..7aa7afec5dc013785973a5ef2d13bf8367ebe5d6 100644 --- a/components/update_client/updater_state_win.cc +++ b/components/update_client/updater_state_win.cc -@@ -25,20 +25,35 @@ namespace { +@@ -25,20 +25,32 @@ namespace { // Google Update group policy settings. const wchar_t kGoogleUpdatePoliciesKey[] = -+#if defined(BRAVE_CHROMIUM_BUILD) + L"SOFTWARE\\Policies\\BraveSoftware\\Update"; -+#else ++#if 0 L"SOFTWARE\\Policies\\Google\\Update"; +#endif const wchar_t kCheckPeriodOverrideMinutes[] = L"AutoUpdateCheckPeriodMinutes"; const wchar_t kUpdatePolicyValue[] = L"UpdateDefault"; const wchar_t kChromeUpdatePolicyOverride[] = -+#if defined(BRAVE_CHROMIUM_BUILD) + L"Update{AFE6A462-C574-4B8A-AF43-4CC60DF4563B}"; -+#else ++#if 0 L"Update{8A69D345-D564-463C-AFF1-A69D9E530F96}"; +#endif @@ -24,12 +22,11 @@ index 89c2c186f9c095d6c2a9210ca2c4e8a94ee64b98..9f7ba1eb42bb50d21cdc2a905dd45e5d const int kCheckPeriodOverrideMinutesMax = 60 * 24 * 7 * 6; // Google Update registry settings. -+#if defined(BRAVE_CHROMIUM_BUILD) +const wchar_t kRegPathGoogleUpdate[] = L"Software\\BraveSoftware\\Update"; +const wchar_t kRegPathClientsGoogleUpdate[] = + L"Software\\BraveSoftware\\Update\\Clients\\" + L"{B131C935-9BE6-41DA-9599-1F776BEB8019}"; -+#else ++#if 0 const wchar_t kRegPathGoogleUpdate[] = L"Software\\Google\\Update"; const wchar_t kRegPathClientsGoogleUpdate[] = L"Software\\Google\\Update\\Clients\\" diff --git a/patches/extensions-common-manifest_url_handlers.cc.patch b/patches/extensions-common-manifest_url_handlers.cc.patch index 6f4a97da7c42..47a46eac8a6a 100644 --- a/patches/extensions-common-manifest_url_handlers.cc.patch +++ b/patches/extensions-common-manifest_url_handlers.cc.patch @@ -1,14 +1,12 @@ diff --git a/extensions/common/manifest_url_handlers.cc b/extensions/common/manifest_url_handlers.cc -index 39450837d2a4ab5e1ab2dc91a234524523f1e36b..ad5ceab85f08a5d3baa153a5a893b96585257f36 100644 +index 39450837d2a4ab5e1ab2dc91a234524523f1e36b..86973a35883c7b5f4cd6d3cd1d050d4cd91f7fbf 100644 --- a/extensions/common/manifest_url_handlers.cc +++ b/extensions/common/manifest_url_handlers.cc -@@ -55,6 +55,9 @@ const GURL ManifestURL::GetManifestHomePageURL(const Extension* extension) { +@@ -55,6 +55,7 @@ const GURL ManifestURL::GetManifestHomePageURL(const Extension* extension) { // static const GURL ManifestURL::GetWebStoreURL(const Extension* extension) { -+#if defined(BRAVE_CHROMIUM_BUILD) + return GURL::EmptyGURL(); -+#endif bool use_webstore_url = UpdatesFromGallery(extension) && !SharedModuleInfo::IsSharedModule(extension); return use_webstore_url diff --git a/patches/net-base-host_port_pair.h.patch b/patches/net-base-host_port_pair.h.patch index a2067025f943..024a79931cd8 100644 --- a/patches/net-base-host_port_pair.h.patch +++ b/patches/net-base-host_port_pair.h.patch @@ -1,12 +1,12 @@ diff --git a/net/base/host_port_pair.h b/net/base/host_port_pair.h -index 1efb721e103ad43bb8799ceed2ce3fc199ccd9e6..99a13040ccc8cafbcc6d24079283ca6740b20a09 100644 +index 1efb721e103ad43bb8799ceed2ce3fc199ccd9e6..0f773eff2ef5b03de11de367ffedb0ea7f861b4e 100644 --- a/net/base/host_port_pair.h +++ b/net/base/host_port_pair.h @@ -36,16 +36,20 @@ class NET_EXPORT HostPortPair { // TODO(willchan): Define a functor instead. // Comparator function so this can be placed in a std::map. -+#if !defined(BRAVE_CHROMIUM_BUILD) ++#if 0 bool operator<(const HostPortPair& other) const { return std::tie(port_, host_) < std::tie(other.port_, other.host_); } @@ -15,7 +15,7 @@ index 1efb721e103ad43bb8799ceed2ce3fc199ccd9e6..99a13040ccc8cafbcc6d24079283ca67 bool operator==(const HostPortPair& other) const { return Equals(other); } // Equality test of contents. (Probably another violation of style guide). -+#if !defined(BRAVE_CHROMIUM_BUILD) ++#if 0 bool Equals(const HostPortPair& other) const { return host_ == other.host_ && port_ == other.port_; } diff --git a/test/BUILD.gn b/test/BUILD.gn index cc174d7c23f5..8e88935efde5 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -491,14 +491,13 @@ if (!is_android && !is_ios) { group("brave_browser_tests_deps") { testonly = true - if (brave_chromium_build) { - # force these to build for tests - deps = [ - "//brave", - "//brave:browser_dependencies", - "//brave:child_dependencies", - ] - } + + # force these to build for tests + deps = [ + "//brave", + "//brave:browser_dependencies", + "//brave:child_dependencies", + ] } static_library("browser_test_support") {