diff --git a/app/brave_exe.rc b/app/brave_exe.rc index 896de0d82251..cc778f67f195 100644 --- a/app/brave_exe.rc +++ b/app/brave_exe.rc @@ -35,6 +35,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Note: chrome/installer/util/shell_util.cc depends on the order and number of // icons. To avoid breaking existing shortcuts, add new icons at the end // (following the ordering described above). +#if defined(OFFICIAL_BUILD) IDR_MAINFRAME ICON "theme\\brave\\win\\brave.ico" // These three are no longer used, but remain as placeholders. (They cannot be // removed, or existing shortcuts to the later resources will break.) @@ -43,18 +44,26 @@ IDR_MAINFRAME_3 ICON "theme\\brave\\win\\placeholder.ico" IDR_MAINFRAME_4 ICON "theme\\brave\\win\\placeholder.ico" // The SXS icon must have an index of 4, the constant is used in Chrome code to // identify it. -IDR_SXS ICON "theme\\brave\\win\\brave_sxs.ico" +IDR_SXS ICON "theme\\brave\\win\\brave_canary.ico" // Start a naming scheme to keep icons in order. A leading X is used to keep // the name alphabetically after IDR_SXS. The maximum of the number that follows // should be incremented when a new icon is added. The icon indices in // chrome_icon_resources_win.h should also be updated. +#else +IDR_MAINFRAME ICON "theme\\brave\\win\\brave_development.ico" +#endif +#if defined(OFFICIAL_BUILD) IDR_X001_APP_LIST ICON "theme\\brave\\win\\app_list.ico" IDR_X002_APP_LIST_SXS ICON "theme\\brave\\win\\app_list_sxs.ico" IDR_X003_INCOGNITO ICON "theme\\brave\\win\\incognito.ico" IDR_X004_DEV ICON "theme\\brave\\win\\brave_dev.ico" IDR_X005_BETA ICON "theme\\brave\\win\\brave_beta.ico" +#else +IDR_X001_APP_LIST ICON "theme\\brave\\win\\app_list.ico" +IDR_X003_INCOGNITO ICON "theme\\brave\\win\\incognito.ico" +#endif #endif // English (U.S.) resources diff --git a/app/theme/brave/win/brave.ico b/app/theme/brave/win/brave.ico index fa029fe76270..938b87bbb05a 100644 Binary files a/app/theme/brave/win/brave.ico and b/app/theme/brave/win/brave.ico differ diff --git a/app/theme/brave/win/brave_beta.ico b/app/theme/brave/win/brave_beta.ico index fa029fe76270..0962d96d19ad 100644 Binary files a/app/theme/brave/win/brave_beta.ico and b/app/theme/brave/win/brave_beta.ico differ diff --git a/app/theme/brave/win/brave_canary.ico b/app/theme/brave/win/brave_canary.ico new file mode 100644 index 000000000000..5357b2e880c1 Binary files /dev/null and b/app/theme/brave/win/brave_canary.ico differ diff --git a/app/theme/brave/win/brave_dev.ico b/app/theme/brave/win/brave_dev.ico index fa029fe76270..2e59f39fe01d 100644 Binary files a/app/theme/brave/win/brave_dev.ico and b/app/theme/brave/win/brave_dev.ico differ diff --git a/app/theme/brave/win/brave_development.ico b/app/theme/brave/win/brave_development.ico new file mode 100644 index 000000000000..474b9fc3eae7 Binary files /dev/null and b/app/theme/brave/win/brave_development.ico differ diff --git a/app/theme/brave/win/brave_sxs.ico b/app/theme/brave/win/brave_sxs.ico deleted file mode 100644 index fa029fe76270..000000000000 Binary files a/app/theme/brave/win/brave_sxs.ico and /dev/null differ diff --git a/app/theme/brave/win/chromium.ico b/app/theme/brave/win/chromium.ico deleted file mode 100644 index fa029fe76270..000000000000 Binary files a/app/theme/brave/win/chromium.ico and /dev/null differ diff --git a/app/theme/brave/win/placeholder.ico b/app/theme/brave/win/placeholder.ico index fa029fe76270..938b87bbb05a 100644 Binary files a/app/theme/brave/win/placeholder.ico and b/app/theme/brave/win/placeholder.ico differ diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index 8ff14b8a6c81..5e131b1efa1f 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -1,12 +1,16 @@ -source_set("browser") { - sources = [] - if (is_win) { - sources += [ +if (is_win) { + source_set("install_static") { + sources = [ + "chrome/common/chrome_icon_resources_win.h", "chrome/install_static/chromium_install_modes.cc", "chrome/install_static/chromium_install_modes.h", ] } } + +source_set("browser") { + sources = [] +} source_set("common") { sources = [] } diff --git a/chromium_src/chrome/common/chrome_icon_resources_win.h b/chromium_src/chrome/common/chrome_icon_resources_win.h index a96643f179e4..e1a870a015fa 100644 --- a/chromium_src/chrome/common/chrome_icon_resources_win.h +++ b/chromium_src/chrome/common/chrome_icon_resources_win.h @@ -7,34 +7,42 @@ namespace icon_resources { -// This file contains the indices of icon resources in chrome_exe.rc. +// This file contains the indices of icon resources in brave_exe.rc. enum { // The main application icon is always index 0. kApplicationIndex = 0, +#if defined(OFFICIAL_BUILD) // Legacy indices that are no longer used. kApplication2Index = 1, kApplication3Index = 2, kApplication4Index = 3, - // The Chrome Canary application icon. + // The Brave Canary application icon. kSxSApplicationIndex = 4, - // The Chrome App Launcher icon. + // The Brave App Launcher icon. kAppLauncherIndex = 5, - // The Chrome App Launcher Canary icon. + // The Brave App Launcher Canary icon. kSxSAppLauncherIndex = 6, - // The Chrome incognito icon. + // The Brave incognito icon. kIncognitoIndex = 7, - // The Chrome Dev application icon. + // The Brave Dev application icon. kDevApplicationIndex = 8, - // The Chrome Beta application icon. + // The Brave Beta application icon. kBetaApplicationIndex = 9, +#else + // The Brave Developer App Launcher icon. + kAppLauncherIndex = 1, + + // The Brave Developer incognito icon. + kIncognitoIndex = 2, +#endif }; } // namespace icon_resources diff --git a/chromium_src/chrome/install_static/chromium_install_modes.cc b/chromium_src/chrome/install_static/chromium_install_modes.cc index 43dd95dd6cfc..fb9430d11c3f 100644 --- a/chromium_src/chrome/install_static/chromium_install_modes.cc +++ b/chromium_src/chrome/install_static/chromium_install_modes.cc @@ -14,15 +14,24 @@ namespace install_static { const wchar_t kCompanyPathName[] = L"BraveSoftware"; -const wchar_t kProductPathName[] = L"Brave"; +#if defined(OFFICIAL_BUILD) +const wchar_t kProductPathName[] = L"Brave-Browser"; +#else +const wchar_t kProductPathName[] = L"Brave-Browser-Development"; +#endif const size_t kProductPathNameLength = _countof(kProductPathName) - 1; +#if defined(OFFICIAL_BUILD) const wchar_t kBinariesAppGuid[] = L"{F7526127-0B8A-406F-8998-282BEA40103A}"; +#else +const wchar_t kBinariesAppGuid[] = L""; +#endif // Brave integrates with Brave Update, so the app GUID above is used. const wchar_t kBinariesPathName[] = L""; +#if defined(OFFICIAL_BUILD) const InstallConstants kInstallModes[] = { // The primary install mode for stable Brave. { @@ -56,13 +65,13 @@ const InstallConstants kInstallModes[] = { { sizeof(kInstallModes[0]), BETA_INDEX, // The mode for the side-by-side beta channel. - "brave-beta", // Install switch. - L" Beta", // Install suffix. + "beta", // Install switch. + L"-Beta", // Install suffix. L"Beta", // Logo suffix. L"{103BD053-949B-43A8-9120-2E424887DE11}", // A distinct app GUID. L"Brave Beta", // A distinct base_app_name. L"BraveBeta", // A distinct base_app_id. - L"BraveHTML", // ProgID prefix. + L"BraveBHTML", // ProgID prefix. L"Brave Beta HTML Document", // ProgID description. L"{103BD053-949B-43A8-9120-2E424887DE11}", // Active Setup GUID. L"", // CommandExecuteImpl CLSID. @@ -84,8 +93,8 @@ const InstallConstants kInstallModes[] = { { sizeof(kInstallModes[0]), DEV_INDEX, // The mode for the side-by-side dev channel. - "brave-dev", // Install switch. - L" Dev", // Install suffix. + "dev", // Install switch. + L"-Dev", // Install suffix. L"Dev", // Logo suffix. L"{CB2150F2-595F-4633-891A-E39720CE0531}", // A distinct app GUID. L"Brave Dev", // A distinct base_app_name. @@ -112,8 +121,8 @@ const InstallConstants kInstallModes[] = { { sizeof(kInstallModes[0]), CANARY_INDEX, // The mode for the side-by-side canary channel. - "brave-sxs", // Install switch. - L" SxS", // Install suffix. + "canary", // Install switch. + L"-Canary", // Install suffix. L"Canary", // Logo suffix. L"{C6CB981E-DB30-4876-8639-109F8933582C}", // A distinct app GUID. L"Brave Canary", // A distinct base_app_name. @@ -137,6 +146,38 @@ const InstallConstants kInstallModes[] = { IDR_SXS, // App icon resource id. }, }; +#else +const InstallConstants kInstallModes[] = { + // The primary (and only) install mode for Brave developer build. + { + sizeof(kInstallModes[0]), + DEVELOPER_INDEX, // The one and only mode for developer mode. + "", // No install switch for the primary install mode. + L"", // Empty install_suffix for the primary install mode. + L"", // No logo suffix for the primary install mode. + L"", // Empty app_guid since no integraion with Brave Update. + L"Brave Developer", // A distinct base_app_name. + L"BraveDeveloper", // A distinct base_app_id. + L"BraveDevHTM", // ProgID prefix. + L"Brave Developer HTML Document", // ProgID description. + L"{C6CB981E-DB30-4876-8639-109F8933582C}", // Active Setup GUID. + L"{312ABB99-A176-4939-A39F-E8D34EA4D393}", // CommandExecuteImpl CLSID. + { 0xf2edbc59, + 0x7217, + 0x4da5, + { 0xa2, 0x59, 0x3, 0x2, 0xda, 0x6a, 0x0, + 0xe1 } }, // Toast activator CLSID. + L"", // Empty default channel name since no update integration. + ChannelStrategy::UNSUPPORTED, + true, // Supports system-level installs. + true, // Supports in-product set as default browser UX. + false, // Does not support retention experiments. + true, // Supported multi-install. + icon_resources::kApplicationIndex, // App icon resource index. + IDR_MAINFRAME, // App icon resource id. + }, +}; +#endif static_assert(_countof(kInstallModes) == NUM_INSTALL_MODES, "Imbalance between kInstallModes and InstallConstantIndex"); diff --git a/chromium_src/chrome/install_static/chromium_install_modes.h b/chromium_src/chrome/install_static/chromium_install_modes.h index 6401fd43e53c..ae07a0adcf18 100644 --- a/chromium_src/chrome/install_static/chromium_install_modes.h +++ b/chromium_src/chrome/install_static/chromium_install_modes.h @@ -16,10 +16,14 @@ enum : bool { // Note: This list of indices must be kept in sync with the brand-specific // resource strings in chrome/installer/util/prebuild/create_string_rc. enum InstallConstantIndex { +#if defined(OFFICIAL_BUILD) STABLE_INDEX, BETA_INDEX, DEV_INDEX, CANARY_INDEX, + #else + DEVELOPER_INDEX, + #endif NUM_INSTALL_MODES, }; diff --git a/chromium_src/common/chrome_icon_resources_win.h b/chromium_src/common/chrome_icon_resources_win.h deleted file mode 100644 index 887d58240d0f..000000000000 --- a/chromium_src/common/chrome_icon_resources_win.h +++ /dev/null @@ -1,42 +0,0 @@ -/* 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_COMMON_BRAVE_ICON_RESOURCES_WIN_H_ -#define BRAVE_COMMON_BRAVE_ICON_RESOURCES_WIN_H_ - -namespace icon_resources { - -// This file contains the indices of icon resources in chrome_exe.rc. - -enum { - // The main application icon is always index 0. - kApplicationIndex = 0, - - // Legacy indices that are no longer used. - kApplication2Index = 1, - kApplication3Index = 2, - kApplication4Index = 3, - - // The Chrome Canary application icon. - kSxSApplicationIndex = 4, - - // The Chrome App Launcher icon. - kAppLauncherIndex = 5, - - // The Chrome App Launcher Canary icon. - kSxSAppLauncherIndex = 6, - - // The Chrome incognito icon. - kIncognitoIndex = 7, - - // The Chrome Dev application icon. - kDevApplicationIndex = 8, - - // The Chrome Beta application icon. - kBetaApplicationIndex = 9, -}; - -} // namespace icon_resources - -#endif // BRAVE_COMMON_BRAVE_ICON_RESOURCES_WIN_H_ diff --git a/chromium_src/python_modules/chrome/installer/util/prebuild/create_string_rc.py b/chromium_src/python_modules/chrome/installer/util/prebuild/create_string_rc.py index 884bd70fdb32..21c207d4ebe1 100644 --- a/chromium_src/python_modules/chrome/installer/util/prebuild/create_string_rc.py +++ b/chromium_src/python_modules/chrome/installer/util/prebuild/create_string_rc.py @@ -15,6 +15,9 @@ 'IDS_APP_SHORTCUTS_SUBDIR_NAME_DEV', 'IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY', ], + 'brave-development': [ + 'IDS_APP_SHORTCUTS_SUBDIR_NAME', + ], }, 'IDS_INBOUND_MDNS_RULE_DESCRIPTION': { 'google_chrome': [ @@ -32,6 +35,9 @@ 'IDS_INBOUND_MDNS_RULE_DESCRIPTION_DEV', 'IDS_INBOUND_MDNS_RULE_DESCRIPTION_CANARY', ], + 'brave-development': [ + 'IDS_INBOUND_MDNS_RULE_DESCRIPTION', + ], }, 'IDS_INBOUND_MDNS_RULE_NAME': { 'google_chrome': [ @@ -49,6 +55,9 @@ 'IDS_INBOUND_MDNS_RULE_NAME_DEV', 'IDS_INBOUND_MDNS_RULE_NAME_CANARY', ], + 'brave-development': [ + 'IDS_INBOUND_MDNS_RULE_NAME', + ], }, # In contrast to the strings above, this one (IDS_PRODUCT_NAME) is used # throughout Chrome in mode-independent contexts. Within the installer (the @@ -70,5 +79,8 @@ 'IDS_SHORTCUT_NAME_DEV', 'IDS_SXS_SHORTCUT_NAME', ], + 'brave-development': [ + 'IDS_PRODUCT_NAME', + ], }, } diff --git a/patches/chrome-BUILD.gn.patch b/patches/chrome-BUILD.gn.patch index 928a33101b68..3ef57252a57d 100644 --- a/patches/chrome-BUILD.gn.patch +++ b/patches/chrome-BUILD.gn.patch @@ -1,17 +1,24 @@ diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e89367a1d 100644 +index 960921acd7ebb0ba99092745e8d30bca76821f2a..534fe8a987d939b2dc24c8cf20d4e950dac4abe5 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -167,7 +167,7 @@ if (!is_android && !is_mac) { +@@ -180,6 +180,15 @@ if (!is_android && !is_mac) { + "common/crash_keys.h", + ] - if (is_win) { - sources += [ -- "app/chrome_exe.rc", -+ "//brave/app/brave_exe.rc", - "app/chrome_exe_load_config_win.cc", - "app/chrome_exe_main_win.cc", - "app/chrome_watcher_client_win.cc", -@@ -241,6 +241,8 @@ if (!is_android && !is_mac) { ++ if (brave_chromium_build) { ++ sources -= [ ++ "app/chrome_exe.rc", ++ ] ++ sources += [ ++ "//brave/app/brave_exe.rc", ++ ] ++ } ++ + deps += [ + ":chrome_dll", + ":chrome_exe_version", +@@ -241,6 +250,8 @@ if (!is_android && !is_mac) { "app/chrome_main.cc", "app/chrome_main_delegate.cc", "app/chrome_main_delegate.h", @@ -20,7 +27,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e ] deps += [ -@@ -318,7 +320,7 @@ if (!is_android && !is_mac) { +@@ -318,7 +329,7 @@ if (!is_android && !is_mac) { if (is_win) { output_name = "initialexe/chrome" } else { @@ -29,7 +36,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e } sources = [] -@@ -367,6 +369,8 @@ if (is_win) { +@@ -367,6 +378,8 @@ if (is_win) { "app/chrome_main.cc", "app/chrome_main_delegate.cc", "app/chrome_main_delegate.h", @@ -38,7 +45,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e ] output_name = "chrome" -@@ -475,6 +479,8 @@ if (is_win) { +@@ -475,6 +488,8 @@ if (is_win) { "app/chrome_main.cc", "app/chrome_main_delegate.cc", "app/chrome_main_delegate.h", @@ -47,7 +54,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e ] configs += [ "//build/config/compiler:wexit_time_destructors" ] -@@ -544,7 +550,9 @@ if (is_win) { +@@ -544,7 +559,9 @@ if (is_win) { } else if (is_mac) { chrome_helper_name = chrome_product_full_name + " Helper" chrome_framework_name = chrome_product_full_name + " Framework" @@ -58,7 +65,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e group("chrome") { deps = [ -@@ -593,6 +601,12 @@ if (is_win) { +@@ -593,6 +610,12 @@ if (is_win) { "--scm=1", "--bundle_id=$chrome_mac_bundle_id", ] @@ -71,7 +78,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e } mac_app_bundle("chrome_app") { -@@ -661,7 +675,7 @@ if (is_win) { +@@ -661,7 +684,7 @@ if (is_win) { args = [ "-b", @@ -80,7 +87,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e "-v", rebase_path(chrome_version_file, root_build_dir), "-g", -@@ -710,6 +724,23 @@ if (is_win) { +@@ -710,6 +733,23 @@ if (is_win) { "app/theme/$branding_path_component/mac/document.icns", "browser/ui/cocoa/applescript/scripting.sdef", ] @@ -104,7 +111,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}", ] -@@ -1162,6 +1193,8 @@ if (is_win) { +@@ -1162,6 +1202,8 @@ if (is_win) { "app/chrome_main.cc", "app/chrome_main_delegate.cc", "app/chrome_main_delegate.h", @@ -113,7 +120,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e "app/chrome_main_mac.h", "app/chrome_main_mac.mm", ] -@@ -1226,6 +1259,7 @@ if (is_win) { +@@ -1226,6 +1268,7 @@ if (is_win) { public_deps = [ ":chrome_dll", @@ -121,7 +128,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e ] deps = [ -@@ -1400,6 +1434,7 @@ if (is_win) { +@@ -1400,6 +1443,7 @@ if (is_win) { group("browser_dependencies") { public_deps = [ @@ -129,7 +136,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e "//chrome/browser", "//chrome/common", "//components/sync", -@@ -1437,6 +1472,7 @@ group("browser_dependencies") { +@@ -1437,6 +1481,7 @@ group("browser_dependencies") { group("child_dependencies") { public_deps = [ @@ -137,7 +144,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e "//chrome/browser/devtools", "//chrome/child", "//chrome/common", -@@ -1458,7 +1494,7 @@ group("child_dependencies") { +@@ -1458,7 +1503,7 @@ group("child_dependencies") { if (is_win) { process_version_rc_template("chrome_exe_version") { sources = [ @@ -146,7 +153,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e ] output = "$target_gen_dir/chrome_exe_version.rc" } -@@ -1741,6 +1777,8 @@ if (is_android) { +@@ -1741,6 +1786,8 @@ if (is_android) { "app/android/chrome_main_delegate_android.h", "app/chrome_main_delegate.cc", "app/chrome_main_delegate.h", @@ -155,7 +162,7 @@ index 960921acd7ebb0ba99092745e8d30bca76821f2a..b227e43ca392c5997f4bfea3e2ba2f9e ] include_dirs = [ android_ndk_include_dir ] -@@ -1796,7 +1834,7 @@ if (is_linux) { +@@ -1796,7 +1843,7 @@ if (is_linux) { dump_syms_binary = get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms" diff --git a/patches/chrome-app-chrome_command_ids.h.patch b/patches/chrome-app-chrome_command_ids.h.patch new file mode 100644 index 000000000000..6e9c225442b2 --- /dev/null +++ b/patches/chrome-app-chrome_command_ids.h.patch @@ -0,0 +1,15 @@ +diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h +index 19f5716f08337202e4a4bac34abcaeb6db8bc941..0c42de3cd68533e52a59cf3a213132e2d782073b 100644 +--- a/chrome/app/chrome_command_ids.h ++++ b/chrome/app/chrome_command_ids.h +@@ -5,6 +5,10 @@ + #ifndef CHROME_APP_CHROME_COMMAND_IDS_H_ + #define CHROME_APP_CHROME_COMMAND_IDS_H_ + ++#if defined(BRAVE_CHROMIUM_BUILD) ++#include "brave/app/brave_command_ids.h" ++#endif ++ + // This file lists all the command IDs understood by e.g. the browser. + // It is used by Windows RC files, Mac NIB files, and other platforms too. + diff --git a/patches/chrome-app-chrome_dll.rc.patch b/patches/chrome-app-chrome_dll.rc.patch new file mode 100644 index 000000000000..c5ba619b08ea --- /dev/null +++ b/patches/chrome-app-chrome_dll.rc.patch @@ -0,0 +1,29 @@ +diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc +index 067e5a41e28989d7b9ba34bc7e5a23c552aa7832..72581f368af331de3c9e38e5a86ed7a5dc0b960e 100644 +--- a/chrome/app/chrome_dll.rc ++++ b/chrome/app/chrome_dll.rc +@@ -164,6 +164,16 @@ 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" ++IDR_X004_DEV ICON "theme\brave\win\brave_dev.ico" ++IDR_X005_BETA ICON "theme\brave\win\brave_beta.ico" ++#else ++IDR_MAINFRAME ICON "theme\brave\win\brave_development.ico" ++#endif ++#else + #if defined(GOOGLE_CHROME_BUILD) + 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_ + #else + IDR_MAINFRAME ICON "theme\chromium\win\chromium.ico" + #endif ++#endif + + // We include these resources because all ICON types need to be in the + // same .rc file. See: diff --git a/patches/chrome-common-BUILD.gn.patch b/patches/chrome-common-BUILD.gn.patch index f5ad1ab3a8b4..56d7059a664f 100644 --- a/patches/chrome-common-BUILD.gn.patch +++ b/patches/chrome-common-BUILD.gn.patch @@ -1,8 +1,22 @@ diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn -index d08a945c6b11a918fa5faedcb1c87c269772e877..8c8c06d11ea3948f558eb984c16ccdb6d5f380b3 100644 +index d08a945c6b11a918fa5faedcb1c87c269772e877..946a111464968bf780a4cf9ffad851c435b4e228 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn -@@ -554,6 +554,15 @@ static_library("constants") { +@@ -528,6 +528,13 @@ static_library("non_code_constants") { + "env_vars.h", + ] + ++ if (brave_chromium_build && is_win) { ++ sources -= [ "chrome_icon_resources_win.h" ] ++ sources += [ ++ "//brave/chromium_src/chrome/common/chrome_icon_resources_win.h", ++ ] ++ } ++ + deps = [ + ":version_header", + "//base", +@@ -554,6 +561,15 @@ static_library("constants") { "pref_names.h", ] diff --git a/patches/chrome-common-chrome_constants.cc.patch b/patches/chrome-common-chrome_constants.cc.patch index 0d2cf6a5b5e9..94d3c912ecbe 100644 --- a/patches/chrome-common-chrome_constants.cc.patch +++ b/patches/chrome-common-chrome_constants.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc -index f32ffad1a95bc31b6571a624333420e88d98913a..83ba0263ef51cd207b062352f00c283bedd6cd46 100644 +index f32ffad1a95bc31b6571a624333420e88d98913a..80826621b07f21531772725ce3679f472a39a6f1 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -10,11 +10,11 @@ @@ -100,12 +100,3 @@ index f32ffad1a95bc31b6571a624333420e88d98913a..83ba0263ef51cd207b062352f00c283b #endif // OS_* #if defined(OS_MACOSX) -@@ -121,7 +121,7 @@ const base::FilePath::CharType kFrameworkExecutableName[] = - #endif // OS_MACOSX - - #if defined(OS_WIN) --const base::FilePath::CharType kBrowserResourcesDll[] = FPL("chrome.dll"); -+const base::FilePath::CharType kBrowserResourcesDll[] = FPL("brave.dll"); - const base::FilePath::CharType kStatusTrayWindowClass[] = - FPL("Chrome_StatusTrayWindow"); - #endif // defined(OS_WIN) diff --git a/patches/chrome-install_static-BUILD.gn.patch b/patches/chrome-install_static-BUILD.gn.patch new file mode 100644 index 000000000000..5b3f6d732e47 --- /dev/null +++ b/patches/chrome-install_static-BUILD.gn.patch @@ -0,0 +1,23 @@ +diff --git a/chrome/install_static/BUILD.gn b/chrome/install_static/BUILD.gn +index bebbab34ae8f822c33350214c8af8ea41690e3a0..2a32747dabf77e7dcc294bc13d8b9e2e3b3f62eb 100644 +--- a/chrome/install_static/BUILD.gn ++++ b/chrome/install_static/BUILD.gn +@@ -50,6 +50,18 @@ static_library("install_static_util") { + ] + } + ++ if (brave_chromium_build) { ++ sources -= [ ++ "../chrome/common/chrome_icon_resources_win.h", ++ "chromium_install_modes.cc", ++ "chromium_install_modes.h", ++ ] ++ ++ deps += [ ++ "//brave/chromium_src:install_static", ++ ] ++ } ++ + libs = [ "kernel32.lib" ] + + configs += [ diff --git a/patches/chrome-install_static-chromium_install_modes.cc.patch b/patches/chrome-install_static-chromium_install_modes.cc.patch deleted file mode 100644 index 0ed4f07c8602..000000000000 --- a/patches/chrome-install_static-chromium_install_modes.cc.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/chrome/install_static/chromium_install_modes.cc b/chrome/install_static/chromium_install_modes.cc -index 1ba8cefa0770a66deaec2724a17f693755ab4e7c..7aa3ece4f889471bf69ba85cb264f0d9562d27a7 100644 ---- a/chrome/install_static/chromium_install_modes.cc -+++ b/chrome/install_static/chromium_install_modes.cc -@@ -14,7 +14,11 @@ namespace install_static { - - const wchar_t kCompanyPathName[] = L""; - --const wchar_t kProductPathName[] = L"Chromium"; -+#if defined(OFFICIAL_BUILD) -+const wchar_t kProductPathName[] = L"Brave-Browser"; -+#else -+const wchar_t kProductPathName[] = L"Brave-Browser-Development"; -+#endif - - const size_t kProductPathNameLength = _countof(kProductPathName) - 1; - diff --git a/patches/chrome-installer-util-BUILD.gn.patch b/patches/chrome-installer-util-BUILD.gn.patch new file mode 100644 index 000000000000..5f1959c4d426 --- /dev/null +++ b/patches/chrome-installer-util-BUILD.gn.patch @@ -0,0 +1,22 @@ +diff --git a/chrome/installer/util/BUILD.gn b/chrome/installer/util/BUILD.gn +index 2cf4027737f73cff9fcd061ed46b6b92f3587e84..a219b96e2cfb12f641c87475740a776487bdffac 100644 +--- a/chrome/installer/util/BUILD.gn ++++ b/chrome/installer/util/BUILD.gn +@@ -246,9 +246,16 @@ action("generate_strings") { + "$target_gen_dir/installer_util_strings.rc", + ] + ++ brand = "$branding_path_component" ++ ++ if (brave_chromium_build && !is_official_build) { ++ # TODO(shong): Remove this. ++ brand = brand + "-development" ++ } ++ + args = [ + "-b", +- "$branding_path_component", ++ brand, + "-i", + rebase_path(grdfile, root_build_dir) + ":resources", + "-n", diff --git a/patches/chrome-installer-util-util_constants.cc.patch b/patches/chrome-installer-util-util_constants.cc.patch index 27ab9eb787a0..e960a4d6caba 100644 --- a/patches/chrome-installer-util-util_constants.cc.patch +++ b/patches/chrome-installer-util-util_constants.cc.patch @@ -1,17 +1,16 @@ diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc -index e8913e34bd4731886c2709db051ed9a0bf3115ac..aa7779e71a9772cd628ed20835a2d7ca0c56c7f7 100644 +index e8913e34bd4731886c2709db051ed9a0bf3115ac..123a271896d765ef633814a554200127754fc0da 100644 --- a/chrome/installer/util/util_constants.cc +++ b/chrome/installer/util/util_constants.cc -@@ -184,9 +184,9 @@ const char kGoogleUpdateIsMachineEnvVar[] = "GoogleUpdateIsMachine"; +@@ -184,7 +184,11 @@ const char kGoogleUpdateIsMachineEnvVar[] = "GoogleUpdateIsMachine"; const wchar_t kActiveSetupExe[] = L"chrmstp.exe"; const wchar_t kChromeDll[] = L"chrome.dll"; const wchar_t kChromeChildDll[] = L"chrome_child.dll"; --const wchar_t kChromeExe[] = L"chrome.exe"; --const wchar_t kChromeNewExe[] = L"new_chrome.exe"; --const wchar_t kChromeOldExe[] = L"old_chrome.exe"; ++#if defined(BRAVE_CHROMIUM_BUILD) +const wchar_t kChromeExe[] = L"brave.exe"; -+const wchar_t kChromeNewExe[] = L"new_brave.exe"; -+const wchar_t kChromeOldExe[] = L"old_brave.exe"; ++#else + const wchar_t kChromeExe[] = L"chrome.exe"; ++#endif + const wchar_t kChromeNewExe[] = L"new_chrome.exe"; + const wchar_t kChromeOldExe[] = L"old_chrome.exe"; const wchar_t kCmdOnOsUpgrade[] = L"on-os-upgrade"; - const wchar_t kEULASentinelFile[] = L"EULA Accepted"; - const wchar_t kInstallBinaryDir[] = L"Application";