diff --git a/build/patches/User-agent-customization.patch b/build/patches/User-agent-customization.patch index c03e867c..33b229dc 100644 --- a/build/patches/User-agent-customization.patch +++ b/build/patches/User-agent-customization.patch @@ -2,10 +2,10 @@ From: uazo Date: Fri, 9 Apr 2021 20:09:08 +0000 Subject: User agent customization -Add flag to always view the desktop site for all websites Add possibility to define a custom User agent for mobile and desktop mode. -Add possibility to reactivate the metatag view for desktop mode, allowing users to choose -to use the flag in the hamburger menu to navigate with a custom useragent leaving the standard navigation unchanged. +Add possibility to reactivate the metatag view for desktop mode. +The menu item in the hamburger menu applies to the tab only, +whereas the content setting is intended for use in a specific site. Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html @@ -16,23 +16,29 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/android/chrome_java_sources.gni | 1 + .../layout/custom_useragent_preferences.xml | 106 ++++++++++ .../android/java/res/xml/main_preferences.xml | 5 + - .../java/res/xml/useragent_preferences.xml | 31 +++ + .../java/res/xml/useragent_preferences.xml | 25 +++ + .../chrome/browser/app/ChromeActivity.java | 2 +- .../init/ChromeBrowserInitializer.java | 3 + .../PrivacyPreferencesManagerImpl.java | 42 ++++ - .../settings/UserAgentPreferences.java | 188 ++++++++++++++++++ - .../chromium/chrome/browser/tab/TabImpl.java | 94 ++++++++- - .../chromium/chrome/browser/tab/TabUtils.java | 24 ++- + .../settings/UserAgentPreferences.java | 183 ++++++++++++++++++ + .../browser/tab/RequestDesktopUtils.java | 1 + + .../chromium/chrome/browser/tab/TabImpl.java | 71 +++++-- + .../chromium/chrome/browser/tab/TabUtils.java | 17 +- .../browser/android/content/content_utils.cc | 30 +++ .../preferences/browser_prefs_android.cc | 7 + .../privacy_preferences_manager_impl.cc | 124 ++++++++++++ - .../preferences/ChromePreferenceKeys.java | 7 +- + ...ktop_site_web_contents_observer_android.cc | 11 ++ + ...sktop_site_web_contents_observer_android.h | 2 + + .../preferences/ChromePreferenceKeys.java | 2 - .../settings/PrivacyPreferencesManager.java | 8 + .../org/chromium/chrome/browser/tab/Tab.java | 2 + .../browser/tabmodel/TabWindowManager.java | 2 + .../tabmodel/TabWindowManagerImpl.java | 18 ++ - .../strings/android_chrome_strings.grd | 35 ++++ + .../strings/android_chrome_strings.grd | 26 +++ chrome/common/pref_names.h | 8 + - .../widget/RadioButtonWithEditText.java | 11 + + ...omiteRequestDesktopSiteContentSetting.java | 76 ++++++++ + .../request_desktop_site.grdp | 18 ++ + .../widget/RadioButtonWithEditText.java | 11 ++ .../embedder_support/user_agent_utils.cc | 3 +- .../navigation_controller_android.cc | 4 + .../navigation_controller_android.h | 1 + @@ -40,10 +46,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../browser/web_contents/web_contents_impl.cc | 6 +- .../framehost/NavigationControllerImpl.java | 3 +- content/renderer/render_thread_impl.cc | 1 - - 30 files changed, 752 insertions(+), 19 deletions(-) + 36 files changed, 794 insertions(+), 32 deletions(-) create mode 100644 chrome/android/java/res/layout/custom_useragent_preferences.xml create mode 100644 chrome/android/java/res/xml/useragent_preferences.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/UserAgentPreferences.java + create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteRequestDesktopSiteContentSetting.java + create mode 100644 components/browser_ui/strings/bromite_content_settings/request_desktop_site.grdp diff --git a/base/base_switches.cc b/base/base_switches.cc --- a/base/base_switches.cc @@ -220,7 +228,7 @@ diff --git a/chrome/android/java/res/xml/useragent_preferences.xml b/chrome/andr new file mode 100644 --- /dev/null +++ b/chrome/android/java/res/xml/useragent_preferences.xml -@@ -0,0 +1,31 @@ +@@ -0,0 +1,25 @@ + +