mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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.
This commit is contained in:
@ -1,22 +1,24 @@
|
||||
diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
|
||||
index 569518f209aeb..a4944e7060570 100644
|
||||
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 "chrome/common/chrome_switches.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,10 @@
|
||||
@@ -20,6 +21,12 @@
|
||||
namespace embedder_support {
|
||||
|
||||
std::string GetProduct() {
|
||||
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
+ if (command_line->HasSwitch(switches::kProductVersion))
|
||||
+ return command_line->GetSwitchValueASCII(switches::kProductVersion);
|
||||
+ if (command_line->HasSwitch(switches::kUserAgentProductAndVersion)) {
|
||||
+ return command_line->GetSwitchValueASCII(
|
||||
+ switches::kUserAgentProductAndVersion);
|
||||
+ }
|
||||
+
|
||||
return version_info::GetProductNameAndVersionForUserAgent();
|
||||
}
|
||||
|
Reference in New Issue
Block a user