cef/patch/patches/chrome_browser_product_override.patch
Marshall Greenblatt a584bd187b Update to Chromium version 88.0.4324.0 (#827102)
- Mac: Xcode 12.2 and the MacOS 11.0 SDK are now required for building.
- MacOS 10.10 (Yosemite) is no longer supported (see https://crbug.com/1126056).
- Flash is no longer supported (see https://www.chromium.org/flash-roadmap).
2020-12-04 15:43:33 -05:00

45 lines
1.7 KiB
Diff

diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index 957a3e09113f..1d8a5bdac349 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -1052,10 +1052,6 @@ void LaunchURL(const GURL& url,
}
}
-std::string GetProduct() {
- return version_info::GetProductNameAndVersionForUserAgent();
-}
-
void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) {
// |allowlist| combines pref/policy + cmdline switch in the browser process.
// For renderer and utility (e.g. NetworkService) processes the switch is the
@@ -1234,6 +1230,14 @@ const blink::UserAgentBrandList& GetBrandVersionList() {
return *greased_brand_version_list;
}
+std::string GetProduct() {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kProductVersion))
+ return command_line->GetSwitchValueASCII(switches::kProductVersion);
+
+ return version_info::GetProductNameAndVersionForUserAgent();
+}
+
std::string GetUserAgent() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kUserAgent)) {
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index c6f87c148d16..bdc93db224d0 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -101,7 +101,8 @@ class ChromeXrIntegrationClient;
}
#endif
-// Returns the user agent of Chrome.
+// Returns the product and user agent of Chrome.
+std::string GetProduct();
std::string GetUserAgent();
blink::UserAgentMetadata GetUserAgentMetadata();