Files
cef/patch/patches/chrome_browser_product_override.patch
2019-11-19 19:17:53 -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 04a864ebd3e3..4fb7f7daa41f 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -993,10 +993,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
@@ -1057,6 +1053,14 @@ bool IsInHostedApp(WebContents* web_contents) {
} // namespace
+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 b80edc76b14f..20ba68634bbc 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -86,7 +86,8 @@ enum class Channel;
class ChromeHidDelegate;
class ChromeSerialDelegate;
-// Returns the user agent of Chrome.
+// Returns the product and user agent of Chrome.
+std::string GetProduct();
std::string GetUserAgent();
blink::UserAgentMetadata GetUserAgentMetadata();