2021-03-04 23:36:57 +01:00
|
|
|
diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
|
2024-05-23 03:52:35 +02:00
|
|
|
index fe76e8806f05f..30b184844a5b5 100644
|
2021-03-04 23:36:57 +01:00
|
|
|
--- components/embedder_support/user_agent_utils.cc
|
|
|
|
+++ components/embedder_support/user_agent_utils.cc
|
2023-05-30 10:55:32 +02:00
|
|
|
@@ -18,6 +18,7 @@
|
2021-10-19 00:17:16 +02:00
|
|
|
#include "base/version.h"
|
2021-03-04 23:36:57 +01:00
|
|
|
#include "build/branding_buildflags.h"
|
2021-09-20 11:06:23 +02:00
|
|
|
#include "build/build_config.h"
|
2023-01-23 18:58:40 +01:00
|
|
|
+#include "cef/libcef/features/features.h"
|
2022-02-21 23:23:40 +01:00
|
|
|
#include "components/embedder_support/pref_names.h"
|
2021-03-04 23:36:57 +01:00
|
|
|
#include "components/embedder_support/switches.h"
|
2021-11-10 22:57:31 +01:00
|
|
|
#include "components/policy/core/common/policy_pref_names.h"
|
2023-05-30 10:55:32 +02:00
|
|
|
@@ -38,6 +39,10 @@
|
2023-01-23 18:58:40 +01:00
|
|
|
#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 {
|
2024-03-19 22:11:42 +01:00
|
|
|
@@ -253,6 +258,14 @@ std::vector<std::string> GetFormFactorsClientHint(
|
2023-09-15 21:51:43 +02:00
|
|
|
|
2022-03-26 02:12:30 +01:00
|
|
|
std::string GetProductAndVersion(
|
2022-06-17 15:28:55 +02:00
|
|
|
UserAgentReductionEnterprisePolicyState user_agent_reduction) {
|
2023-01-23 18:58:40 +01:00
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
2021-03-04 23:36:57 +01:00
|
|
|
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
2021-04-27 18:39:09 +02:00
|
|
|
+ if (command_line->HasSwitch(switches::kUserAgentProductAndVersion)) {
|
|
|
|
+ return command_line->GetSwitchValueASCII(
|
|
|
|
+ switches::kUserAgentProductAndVersion);
|
|
|
|
+ }
|
2023-01-23 18:58:40 +01:00
|
|
|
+#endif
|
2021-03-04 23:36:57 +01:00
|
|
|
+
|
2023-09-15 21:51:43 +02:00
|
|
|
return ShouldReduceUserAgentMinorVersion(user_agent_reduction)
|
|
|
|
? version_info::GetProductNameAndVersionForReducedUserAgent(
|
|
|
|
blink::features::kUserAgentFrozenBuildVersion.Get())
|