Skip to content

Commit 458223c

Browse files
committed
Make various branding updates
1 parent 742299d commit 458223c

10 files changed

+411
-0
lines changed

BUILD.gn

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import("//beacon/build/config.gni")
2+
import("//build/util/process_version.gni")
3+
if (is_mac) {
4+
import("//beacon/build/mac/tweak_info_plist.gni")
5+
}
6+
7+
group("browser_dependencies") {
8+
deps = [
9+
"browser",
10+
"chromium_src:browser",
11+
]
12+
}
13+
14+
group("resources") { }
15+
16+
group("beacon") {
17+
deps = [ "build/$target_os:beacon" ]
18+
if (!is_android && !is_ios) {
19+
deps += [
20+
"//chrome"
21+
]
22+
}
23+
}
24+
25+
if (is_mac) {
26+
group("beacon_app") {
27+
deps = [ ":beacon_app_plist" ]
28+
}
29+
30+
beacon_tweak_info_plist("beacon_app_plist") {
31+
info_plist = "$root_gen_dir/chrome/chrome_app_plist_tweaked.plist"
32+
33+
args = [
34+
"--beacon_channel=" + beacon_channel,
35+
"--beacon_product_dir_name=" + beacon_product_dir_name,
36+
"--beacon_version=" + beacon_version,
37+
]
38+
39+
if (skip_signing) {
40+
args += [ "--skip_signing" ]
41+
}
42+
43+
deps = [ "//chrome:chrome_app_plist" ]
44+
}
45+
46+
beacon_tweak_info_plist("beacon_helper_plist") {
47+
info_plist = "$root_gen_dir/chrome/chrome_helper_plist_tweaked.plist"
48+
49+
args = [
50+
"--beacon_channel=" + beacon_channel,
51+
"--beacon_product_dir_name=" + beacon_product_dir_name,
52+
"--beacon_version=" + beacon_version,
53+
]
54+
55+
deps = [ "//chrome:chrome_helper_plist" ]
56+
}
57+
}
58+
59+
group("installer") {
60+
if (is_mac) {
61+
public_deps = [ "installer/mac" ]
62+
}
63+
}

browser/BUILD.gn

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
group("browser") {
2+
visibility = [
3+
"//beacon:browser_dependencies",
4+
"//beacon/browser/*",
5+
]
6+
7+
# Group depending on upstream's counterpart to make it easier to manage
8+
# dependencies in beacon/ (//chrome/browser does not depend on this target
9+
# so //beacon/browser becomes essentially an alias for //chrome/browser now).
10+
public_deps = [ "//chrome/browser" ]
11+
}

chromium_src/BUILD.gn

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source_set("browser") {
2+
sources = []
3+
}
4+
source_set("common") {
5+
sources = []
6+
}
7+
source_set("renderer") {
8+
sources = []
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "chrome/common/chrome_constants.h"
6+
7+
#include "build/build_config.h"
8+
#include "chrome/common/chrome_version.h"
9+
10+
#define FPL FILE_PATH_LITERAL
11+
12+
#if defined(OS_MAC)
13+
#define PRODUCT_STRING BEACON_PRODUCT_STRING
14+
#endif // defined(OS_MAC)
15+
16+
17+
namespace chrome {
18+
19+
const char kChromeVersion[] = CHROME_VERSION_STRING;
20+
21+
// The following should not be used for UI strings; they are meant
22+
// for system strings only. UI changes should be made in the GRD.
23+
//
24+
// There are four constants used to locate the executable name and path:
25+
//
26+
// kBrowserProcessExecutableName
27+
// kHelperProcessExecutableName
28+
// kBrowserProcessExecutablePath
29+
// kHelperProcessExecutablePath
30+
//
31+
// In one condition, our tests will be built using the Chrome branding
32+
// though we want to actually execute a Chromium branded application.
33+
// This happens for the reference build on Mac. To support that case,
34+
// we also include a Chromium version of each of the four constants and
35+
// in the UITest class we support switching to that version when told to
36+
// do so.
37+
38+
#if defined(OS_WIN)
39+
const base::FilePath::CharType kBrowserProcessExecutableName[] =
40+
FPL("beacon.exe");
41+
const base::FilePath::CharType kHelperProcessExecutableName[] =
42+
FPL("beacon.exe");
43+
#elif defined(OS_MAC)
44+
const base::FilePath::CharType kBrowserProcessExecutableName[] =
45+
FPL(PRODUCT_STRING);
46+
const base::FilePath::CharType kHelperProcessExecutableName[] =
47+
FPL(PRODUCT_STRING " Helper");
48+
#elif defined(OS_ANDROID)
49+
// NOTE: Keep it synced with the process names defined in AndroidManifest.xml.
50+
const base::FilePath::CharType kBrowserProcessExecutableName[] = FPL("beacon");
51+
const base::FilePath::CharType kHelperProcessExecutableName[] =
52+
FPL("sandboxed_process");
53+
#elif defined(OS_POSIX)
54+
const base::FilePath::CharType kBrowserProcessExecutableName[] = FPL("beacon");
55+
// Helper processes end up with a name of "exe" due to execing via
56+
// /proc/self/exe. See bug 22703.
57+
const base::FilePath::CharType kHelperProcessExecutableName[] = FPL("exe");
58+
#endif // OS_*
59+
60+
#if defined(OS_WIN)
61+
const base::FilePath::CharType kBrowserProcessExecutablePath[] =
62+
FPL("beacon.exe");
63+
const base::FilePath::CharType kHelperProcessExecutablePath[] =
64+
FPL("beacon.exe");
65+
#elif defined(OS_MAC)
66+
const base::FilePath::CharType kBrowserProcessExecutablePath[] =
67+
FPL(PRODUCT_STRING ".app/Contents/MacOS/" PRODUCT_STRING);
68+
const base::FilePath::CharType kHelperProcessExecutablePath[] =
69+
FPL(PRODUCT_STRING " Helper.app/Contents/MacOS/" PRODUCT_STRING " Helper");
70+
#elif defined(OS_ANDROID)
71+
const base::FilePath::CharType kBrowserProcessExecutablePath[] = FPL("beacon");
72+
const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("beacon");
73+
#elif defined(OS_POSIX)
74+
const base::FilePath::CharType kBrowserProcessExecutablePath[] = FPL("beacon");
75+
const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("beacon");
76+
#endif // OS_*
77+
78+
#if defined(OS_MAC)
79+
const base::FilePath::CharType kFrameworkName[] =
80+
FPL(PRODUCT_STRING " Framework.framework");
81+
const base::FilePath::CharType kFrameworkExecutableName[] =
82+
FPL(PRODUCT_STRING " Framework");
83+
const char kMacHelperSuffixAlerts[] = " (Alerts)";
84+
#endif // OS_MAC
85+
86+
#if defined(OS_WIN)
87+
const base::FilePath::CharType kBrowserResourcesDll[] = FPL("chrome.dll");
88+
const base::FilePath::CharType kElfDll[] = FPL("chrome_elf.dll");
89+
const base::FilePath::CharType kStatusTrayWindowClass[] =
90+
FPL("Chrome_StatusTrayWindow");
91+
#endif // defined(OS_WIN)
92+
93+
const char kInitialProfile[] = "Default";
94+
const char kMultiProfileDirPrefix[] = "Profile ";
95+
const base::FilePath::CharType kGuestProfileDir[] = FPL("Guest Profile");
96+
const base::FilePath::CharType kSystemProfileDir[] = FPL("System Profile");
97+
98+
// filenames
99+
const base::FilePath::CharType kCacheDirname[] = FPL("Cache");
100+
const base::FilePath::CharType kCookieFilename[] = FPL("Cookies");
101+
const base::FilePath::CharType kCRLSetFilename[] =
102+
FPL("Certificate Revocation Lists");
103+
const base::FilePath::CharType kCustomDictionaryFileName[] =
104+
FPL("Custom Dictionary.txt");
105+
const base::FilePath::CharType kDownloadServiceStorageDirname[] =
106+
FPL("Download Service");
107+
const base::FilePath::CharType kExtensionActivityLogFilename[] =
108+
FPL("Extension Activity");
109+
const base::FilePath::CharType kExtensionsCookieFilename[] =
110+
FPL("Extension Cookies");
111+
const base::FilePath::CharType kFeatureEngagementTrackerStorageDirname[] =
112+
FPL("Feature Engagement Tracker");
113+
const base::FilePath::CharType kFirstRunSentinel[] = FPL("First Run");
114+
const base::FilePath::CharType kGCMStoreDirname[] = FPL("GCM Store");
115+
const base::FilePath::CharType kLocalStateFilename[] = FPL("Local State");
116+
const base::FilePath::CharType kMediaCacheDirname[] = FPL("Media Cache");
117+
const base::FilePath::CharType kNetworkPersistentStateFilename[] =
118+
FPL("Network Persistent State");
119+
const base::FilePath::CharType kNetworkDataDirname[] = FPL("Network");
120+
const base::FilePath::CharType kNotificationSchedulerStorageDirname[] =
121+
FPL("Notification Scheduler");
122+
const base::FilePath::CharType kOfflinePageArchivesDirname[] =
123+
FPL("Offline Pages/archives");
124+
const base::FilePath::CharType kOfflinePageMetadataDirname[] =
125+
FPL("Offline Pages/metadata");
126+
const base::FilePath::CharType kOfflinePagePrefetchStoreDirname[] =
127+
FPL("Offline Pages/prefech_store");
128+
const base::FilePath::CharType kOfflinePageRequestQueueDirname[] =
129+
FPL("Offline Pages/request_queue");
130+
const base::FilePath::CharType kPreferencesFilename[] = FPL("Preferences");
131+
const base::FilePath::CharType kPreviewsOptOutDBFilename[] =
132+
FPL("previews_opt_out.db");
133+
const base::FilePath::CharType kQueryTileStorageDirname[] = FPL("Query Tiles");
134+
const base::FilePath::CharType kReadmeFilename[] = FPL("README");
135+
const base::FilePath::CharType kSCTAuditingPendingReportsFileName[] =
136+
FPL("SCT Auditing Pending Reports");
137+
const base::FilePath::CharType kSecurePreferencesFilename[] =
138+
FPL("Secure Preferences");
139+
const base::FilePath::CharType kServiceStateFileName[] = FPL("Service State");
140+
const base::FilePath::CharType kSegmentationPlatformStorageDirName[] =
141+
FPL("Segmentation Platform");
142+
const base::FilePath::CharType kSingletonCookieFilename[] =
143+
FPL("SingletonCookie");
144+
const base::FilePath::CharType kSingletonLockFilename[] = FPL("SingletonLock");
145+
const base::FilePath::CharType kSingletonSocketFilename[] =
146+
FPL("SingletonSocket");
147+
const base::FilePath::CharType kSupervisedUserSettingsFilename[] =
148+
FPL("Managed Mode Settings");
149+
const base::FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak");
150+
const base::FilePath::CharType kTransportSecurityPersisterFilename[] =
151+
FPL("TransportSecurity");
152+
const base::FilePath::CharType kTrustTokenFilename[] = FPL("Trust Tokens");
153+
const base::FilePath::CharType kVideoTutorialsStorageDirname[] =
154+
FPL("Video Tutorials");
155+
const base::FilePath::CharType kWebAppDirname[] = FPL("Web Applications");
156+
// Only use if the ENABLE_REPORTING build flag is true
157+
const base::FilePath::CharType kReportingAndNelStoreFilename[] =
158+
FPL("Reporting and NEL");
159+
160+
#if defined(OS_WIN)
161+
const base::FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons");
162+
#endif
163+
164+
// directory names
165+
#if defined(OS_WIN)
166+
const wchar_t kUserDataDirname[] = L"User Data";
167+
#endif
168+
169+
const float kMaxShareOfExtensionProcesses = 0.30f;
170+
171+
// This GUID is associated with any 'don't ask me again' settings that the
172+
// user can select for different file types.
173+
// {2676A9A2-D919-4FEE-9187-152100393AB2}
174+
const char kApplicationClientIDStringForAVScanning[] =
175+
"2676A9A2-D919-4FEE-9187-152100393AB2";
176+
177+
} // namespace chrome
178+
179+
#undef FPL

patches/chrome-BUILD.gn.patch

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
2+
index 51555df59f2bf9d0f396b9ffea0524a2533274ec..9a53417e7e48dc70b8b4c0d166353989af1e131c 100644
3+
--- a/chrome/BUILD.gn
4+
+++ b/chrome/BUILD.gn
5+
@@ -170,6 +170,7 @@ if (!is_android && !is_mac) {
6+
"common/crash_keys.cc",
7+
"common/crash_keys.h",
8+
]
9+
+ sources -= [ "app/chrome_exe.rc", ] sources += [ "//beacon/app/beacon_exe.rc" ]
10+
11+
deps += [
12+
":chrome_dll",
13+
@@ -462,10 +463,12 @@ if (is_win) {
14+
}
15+
}
16+
17+
+ copy("beacon_app_plist") { deps = [ "//beacon:beacon_app_plist" ] sources = [ "$root_gen_dir/beacon/beacon_app_plist_tweaked.plist" ] outputs = [ "$root_gen_dir/chrome/{{source_file_part}}" ] }
18+
mac_app_bundle("chrome_app") {
19+
output_name = chrome_product_full_name
20+
21+
info_plist_target = ":chrome_app_plist"
22+
+ info_plist_target = ":beacon_app_plist"
23+
extra_substitutions = [
24+
"CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id",
25+
"CHROMIUM_SHORT_NAME=$chrome_product_short_name",
26+
@@ -485,6 +488,7 @@ if (is_win) {
27+
"//chrome/common:buildflags",
28+
"//chrome/common:version_header",
29+
]
30+
+ deps += [ "//beacon:beacon_app" ]
31+
32+
if (enable_stripping) {
33+
# At link time, preserve the global symbols specified in the .exports
34+
@@ -679,6 +683,7 @@ if (is_win) {
35+
]
36+
}
37+
38+
+ copy("beacon_helper_plist") { deps = [ "//beacon:beacon_helper_plist" ] sources = [ "$root_gen_dir/beacon/beacon_helper_plist_tweaked.plist" ] outputs = [ "$root_gen_dir/chrome/{{source_file_part}}" ] }
39+
compile_entitlements("entitlements") {
40+
entitlements_templates = [ "app/app-entitlements.plist" ]
41+
if (is_chrome_branded) {
42+
@@ -705,6 +710,7 @@ if (is_win) {
43+
info_plist_target = invoker.info_plist_target
44+
} else {
45+
info_plist_target = ":chrome_helper_plist"
46+
+ info_plist_target = ":beacon_helper_plist"
47+
}
48+
49+
extra_substitutions = [
50+
@@ -1203,6 +1209,7 @@ if (is_win) {
51+
chrome_dylib_version,
52+
"-Wl,-order_file," + rebase_path("app/framework.order", root_build_dir),
53+
]
54+
+ import("//beacon/browser/sources.gni") public_deps += beacon_chrome_framework_public_deps bundle_deps += beacon_chrome_framework_bundle_deps framework_contents += beacon_chrome_framework_contents ldflags += beacon_chrome_framework_ldflags
55+
56+
if (!is_component_build) {
57+
# Specify a sensible install_name for static builds. The library is
58+
@@ -1390,6 +1397,7 @@ if (is_win) {
59+
60+
group("browser_dependencies") {
61+
public_deps = [
62+
+ "//beacon:browser_dependencies",
63+
"//build:branding_buildflags",
64+
"//build:chromeos_buildflags",
65+
"//chrome/browser",
66+
@@ -1502,7 +1510,7 @@ group("child_dependencies") {
67+
68+
if (is_win) {
69+
process_version_rc_template("chrome_exe_version") {
70+
- sources = [ "app/chrome_exe.ver" ]
71+
+ sources = [ "//beacon/app/beacon_exe.ver" ]
72+
output = "$target_gen_dir/chrome_exe_version.rc"
73+
}
74+
75+
@@ -1556,6 +1564,7 @@ group("resources") {
76+
"//chrome/browser:resources",
77+
"//chrome/common:resources",
78+
"//chrome/renderer:resources",
79+
+ "//beacon:resources",
80+
]
81+
}
82+

patches/chrome-browser-BUILD.gn.patch

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
2+
index 9917fcf771ecbfceaba4c02164de620d2aaf0775..58de481c085889368dcee3ee5796ef3346b56700 100644
3+
--- a/chrome/browser/BUILD.gn
4+
+++ b/chrome/browser/BUILD.gn
5+
@@ -2532,6 +2532,7 @@ static_library("browser") {
6+
} else {
7+
sources += [ "net/net_error_diagnostics_dialog_stub.cc" ]
8+
}
9+
+ import("//beacon/browser/sources.gni") sources += beacon_chrome_browser_sources deps += beacon_chrome_browser_deps public_deps += beacon_chrome_browser_public_deps defines += beacon_chrome_browser_defines libs += beacon_chrome_browser_libs inputs = beacon_chrome_browser_inputs
10+
11+
if (is_posix || is_fuchsia) {
12+
sources += [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
2+
index 070acc504b606c793fc6463faf1e6b9cd7f34827..aa55d67efca5107fec3e9317c0787a30cd1eef2d 100644
3+
--- a/chrome/browser/shell_integration_linux.cc
4+
+++ b/chrome/browser/shell_integration_linux.cc
5+
@@ -466,7 +466,7 @@ std::string GetIconName() {
6+
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
7+
return "google-chrome";
8+
#else // BUILDFLAG(CHROMIUM_BRANDING)
9+
- return "chromium-browser";
10+
+ return "beacon-browser";
11+
#endif
12+
}
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/chrome/chrome_proxy/chrome_proxy_main_win.cc b/chrome/chrome_proxy/chrome_proxy_main_win.cc
2+
index bdb02d140cf891e387d1f566e6f39692e0ebf35e..534ed16762342d412b6903177bdde92ee7dc92ed 100644
3+
--- a/chrome/chrome_proxy/chrome_proxy_main_win.cc
4+
+++ b/chrome/chrome_proxy/chrome_proxy_main_win.cc
5+
@@ -13,7 +13,10 @@
6+
namespace {
7+
8+
constexpr base::FilePath::CharType kChromeExecutable[] =
9+
+ FILE_PATH_LITERAL("beacon.exe");
10+
+#if 0
11+
FILE_PATH_LITERAL("chrome.exe");
12+
+#endif
13+
14+
constexpr base::FilePath::CharType kChromeProxyExecutable[] =
15+
FILE_PATH_LITERAL("chrome_proxy.exe");

0 commit comments

Comments
 (0)