cef/patch/patches/embedder_product_override.patch
Marshall Greenblatt c03a6f4386 chrome: Support configuration of user agent and locale (see issue #2969)
This change adds support for CefSettings and command-line configuration of
user_agent, user_agent_product (formerly product_version) and locale.
2021-04-27 12:39:12 -04:00

26 lines
973 B
Diff

diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
index 569518f209aeb..0cf7c2cc23c43 100644
--- components/embedder_support/user_agent_utils.cc
+++ components/embedder_support/user_agent_utils.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/strings/strcat.h"
#include "build/branding_buildflags.h"
+#include "cef/libcef/common/cef_switches.h"
#include "components/embedder_support/switches.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/web_contents.h"
@@ -20,6 +21,12 @@
namespace embedder_support {
std::string GetProduct() {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kUserAgentProductAndVersion)) {
+ return command_line->GetSwitchValueASCII(
+ switches::kUserAgentProductAndVersion);
+ }
+
return version_info::GetProductNameAndVersionForUserAgent();
}