cef/patch/patches/embedder_product_override.patch

26 lines
1.0 KiB
Diff
Raw Normal View History

diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
index dfa5022f7636e..fa880d2ea9acd 100644
--- components/embedder_support/user_agent_utils.cc
+++ components/embedder_support/user_agent_utils.cc
@@ -12,6 +12,7 @@
#include "base/system/sys_info.h"
#include "build/branding_buildflags.h"
#include "build/build_config.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"
@@ -113,6 +114,12 @@ std::string GetUniversalApiContractVersion() {
#endif // defined(OS_WIN)
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();
}