[RDSA] Hook up User Agent override for RDS peripheral settings
- UA override for browser initiated navigation in TabImpl
- UA override for renderer initiated navigation in WebContentsObserver
Changes are behind feature flag REQUEST_DESKTOP_SITE_ADDITIONS.
This CL is to wrap up the existing works around RDS additional settings as we shift focus. Will follow up with more changes in the future.
Bug: 1347251
Change-Id: Ie9ff2b4996d596806704ea87e278989c90e2c2f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3787134
Reviewed-by: Theresa Sullivan <[email protected]>
Reviewed-by: Gabriel Charette <[email protected]>
Commit-Queue: Shu Yang <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1031594}
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc
index 1429a688..b70d624 100644
--- a/content/browser/renderer_host/navigation_controller_impl.cc
+++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -1255,7 +1255,8 @@
#if BUILDFLAG(IS_ANDROID)
// TODO(crbug.com/1266277): Clean up the logic of setting
// |overriding_user_agent_changed| post-launch.
- if (base::FeatureList::IsEnabled(features::kRequestDesktopSiteExceptions)) {
+ if (base::FeatureList::IsEnabled(features::kRequestDesktopSiteExceptions) ||
+ base::FeatureList::IsEnabled(features::kRequestDesktopSiteAdditions)) {
// Must honor user agent overrides in the |navigation_request|, such as
// from things like RequestDesktopSiteWebContentsObserverAndroid. As a
// result, besides comparing |pending_entry_|'s user agent against
@@ -1280,7 +1281,8 @@
#if BUILDFLAG(IS_ANDROID)
// TODO(crbug.com/1266277): Clean up the logic of setting
// |overriding_user_agent_changed| post-launch.
- if (base::FeatureList::IsEnabled(features::kRequestDesktopSiteExceptions)) {
+ if (base::FeatureList::IsEnabled(features::kRequestDesktopSiteExceptions) ||
+ base::FeatureList::IsEnabled(features::kRequestDesktopSiteAdditions)) {
// Must honor user agent overrides in the |navigation_request|, such as
// from things like RequestDesktopSiteWebContentsObserverAndroid. As a
// result, besides checking |pending_entry_|'s user agent, also need to