2021-03-04 17:36:57 -05:00
|
|
|
diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
|
2023-01-23 12:58:40 -05:00
|
|
|
index 40148eeaef7d1..bd4e5d62efc97 100644
|
2021-03-04 17:36:57 -05:00
|
|
|
--- components/embedder_support/user_agent_utils.cc
|
|
|
|
+++ components/embedder_support/user_agent_utils.cc
|
2021-12-16 17:35:54 -05:00
|
|
|
@@ -15,6 +15,7 @@
|
2021-10-18 18:17:16 -04:00
|
|
|
#include "base/version.h"
|
2021-03-04 17:36:57 -05:00
|
|
|
#include "build/branding_buildflags.h"
|
2021-09-20 12:06:23 +03:00
|
|
|
#include "build/build_config.h"
|
2023-01-23 12:58:40 -05:00
|
|
|
+#include "cef/libcef/features/features.h"
|
2022-02-21 17:23:40 -05:00
|
|
|
#include "components/embedder_support/pref_names.h"
|
2021-03-04 17:36:57 -05:00
|
|
|
#include "components/embedder_support/switches.h"
|
2021-11-10 16:57:31 -05:00
|
|
|
#include "components/policy/core/common/policy_pref_names.h"
|
2023-01-23 12:58:40 -05:00
|
|
|
@@ -28,6 +29,10 @@
|
|
|
|
#include "third_party/blink/public/common/features.h"
|
|
|
|
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
|
|
|
|
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
|
|
+#include "cef/libcef/common/cef_switches.h"
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#if BUILDFLAG(IS_WIN)
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
@@ -382,6 +387,14 @@ std::string GetMajorVersionForUserAgentString(
|
2022-03-25 21:12:30 -04:00
|
|
|
std::string GetProductAndVersion(
|
2022-06-17 16:28:55 +03:00
|
|
|
ForceMajorVersionToMinorPosition force_major_to_minor,
|
|
|
|
UserAgentReductionEnterprisePolicyState user_agent_reduction) {
|
2023-01-23 12:58:40 -05:00
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
2021-03-04 17:36:57 -05:00
|
|
|
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
2021-04-27 12:39:09 -04:00
|
|
|
+ if (command_line->HasSwitch(switches::kUserAgentProductAndVersion)) {
|
|
|
|
+ return command_line->GetSwitchValueASCII(
|
|
|
|
+ switches::kUserAgentProductAndVersion);
|
|
|
|
+ }
|
2023-01-23 12:58:40 -05:00
|
|
|
+#endif
|
2021-03-04 17:36:57 -05:00
|
|
|
+
|
2022-03-25 21:12:30 -04:00
|
|
|
if (ShouldForceMajorVersionToMinorPosition(force_major_to_minor)) {
|
|
|
|
// Force major version to 99 and major version to minor version position.
|
2022-06-17 16:28:55 +03:00
|
|
|
if (ShouldReduceUserAgentMinorVersion(user_agent_reduction)) {
|