cef/patch/patches/embedder_product_override.patch
Marshall Greenblatt ab94a13522 Update to Chromium version 114.0.5735.0 (#1135570)
- Mac: 13.3 SDK (Xcode 14.3) is now supported (see https://crbug.com/1431897).
- Mac: Removed UnderlayOpenGLHostingWindow which is no longer used.
2023-05-05 22:53:16 +03:00

39 lines
1.5 KiB
Diff

diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
index 86e97af7108a5..1da2d83d72a23 100644
--- components/embedder_support/user_agent_utils.cc
+++ components/embedder_support/user_agent_utils.cc
@@ -17,6 +17,7 @@
#include "base/version.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
#include "components/embedder_support/pref_names.h"
#include "components/embedder_support/switches.h"
#include "components/policy/core/common/policy_pref_names.h"
@@ -37,6 +38,10 @@
#include "base/win/windows_version.h"
#endif // BUILDFLAG(IS_WIN)
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/cef_switches.h"
+#endif
+
namespace embedder_support {
namespace {
@@ -351,6 +356,14 @@ std::string GetMajorVersionForUserAgentString(
std::string GetProductAndVersion(
ForceMajorVersionToMinorPosition force_major_to_minor,
UserAgentReductionEnterprisePolicyState user_agent_reduction) {
+#if BUILDFLAG(ENABLE_CEF)
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kUserAgentProductAndVersion)) {
+ return command_line->GetSwitchValueASCII(
+ switches::kUserAgentProductAndVersion);
+ }
+#endif
+
if (ShouldForceMajorVersionToMinorPosition(force_major_to_minor)) {
// Force major version to 99 and major version to minor version position.
if (ShouldReduceUserAgentMinorVersion(user_agent_reduction)) {