cef/patch/patches/embedder_product_override.patch
2021-08-24 17:43:02 -04:00

26 lines
984 B
Diff

diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
index d9cd3f7c287ad..834c345710aaf 100644
--- components/embedder_support/user_agent_utils.cc
+++ components/embedder_support/user_agent_utils.cc
@@ -10,6 +10,7 @@
#include "base/strings/stringprintf.h"
#include "base/system/sys_info.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"
@@ -23,6 +24,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();
}