mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-03-04 03:47:41 +01:00
This change adds support for CefSettings and command-line configuration of user_agent, user_agent_product (formerly product_version) and locale.
26 lines
973 B
Diff
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();
|
|
}
|
|
|