296 lines
16 KiB
Diff
296 lines
16 KiB
Diff
From: uazo <uazo@users.noreply.github.com>
|
|
Date: Sat, 21 Sep 2024 15:32:02 +0000
|
|
Subject: Cromite Branding: improve settings ui
|
|
|
|
Modification to the settings ui with the aim of making it clearer.
|
|
|
|
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
|
---
|
|
chrome/android/chrome_java_resources.gni | 2 +-
|
|
.../android/java/res/xml/main_preferences.xml | 4 +-
|
|
.../res/xml/privacy_preferences_cromite.xml | 196 ++++++++++++++++++
|
|
.../privacy/settings/PrivacySettings.java | 6 +-
|
|
.../Cromite-settings-ui.grdp | 15 ++
|
|
5 files changed, 218 insertions(+), 5 deletions(-)
|
|
create mode 100644 chrome/android/java/res/xml/privacy_preferences_cromite.xml
|
|
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Cromite-settings-ui.grdp
|
|
|
|
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
|
|
--- a/chrome/android/chrome_java_resources.gni
|
|
+++ b/chrome/android/chrome_java_resources.gni
|
|
@@ -675,7 +675,7 @@ chrome_java_resources = [
|
|
"java/res/xml/manage_sync_preferences.xml",
|
|
"java/res/xml/personalize_google_services_preferences.xml",
|
|
"java/res/xml/incognito_preferences.xml",
|
|
- "java/res/xml/privacy_preferences.xml",
|
|
+ "java/res/xml/privacy_preferences.xml", "java/res/xml/privacy_preferences_cromite.xml",
|
|
"java/res/xml/referer_policy_preferences.xml",
|
|
"java/res/layout/radio_button_group_referer_policy_preference.xml",
|
|
"java/res/xml/search_widget_info.xml",
|
|
diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml
|
|
--- a/chrome/android/java/res/xml/main_preferences.xml
|
|
+++ b/chrome/android/java/res/xml/main_preferences.xml
|
|
@@ -12,7 +12,7 @@ found in the LICENSE file.
|
|
android:key="settings_promo_card"
|
|
android:order="0" />
|
|
<PreferenceCategory
|
|
- android:key="account_and_google_services_section"
|
|
+ android:key="account_and_google_services_section" app:isPreferenceVisible="false"
|
|
android:order="1001"
|
|
android:title="@string/prefs_section_account_and_google_services"/>
|
|
<org.chromium.chrome.browser.sync.settings.SignInPreference
|
|
@@ -24,7 +24,7 @@ found in the LICENSE file.
|
|
android:layout="@layout/account_management_account_row"
|
|
android:title="@string/sync_category_title"/>
|
|
<org.chromium.components.browser_ui.settings.ChromeBasePreference
|
|
- android:key="google_services"
|
|
+ android:key="google_services" app:isPreferenceVisible="false"
|
|
android:order="1004"
|
|
android:layout="@layout/account_management_account_row"
|
|
android:title="@string/prefs_google_services"
|
|
diff --git a/chrome/android/java/res/xml/privacy_preferences_cromite.xml b/chrome/android/java/res/xml/privacy_preferences_cromite.xml
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/chrome/android/java/res/xml/privacy_preferences_cromite.xml
|
|
@@ -0,0 +1,196 @@
|
|
+<?xml version="1.0" encoding="utf-8"?><!--
|
|
+Copyright 2022 The Chromium Authors
|
|
+Use of this source code is governed by a BSD-style license that can be
|
|
+found in the LICENSE file.
|
|
+-->
|
|
+
|
|
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
|
+ xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
+
|
|
+ <PreferenceCategory
|
|
+ android:title="@string/browsing_data_section_title"/>
|
|
+ <Preference
|
|
+ android:key="clear_browsing_data"
|
|
+ android:title="@string/clear_browsing_data_title"
|
|
+ android:summary="@string/clear_browsing_data_summary"
|
|
+ android:fragment="org.chromium.chrome.browser.browsing_data.ClearBrowsingDataFragment" />
|
|
+ <Preference
|
|
+ android:key="clear_browsing_data_advanced"
|
|
+ android:title="@string/clear_browsing_data_at_start_title"
|
|
+ android:summary="@string/clear_browsing_data_at_start_summary"
|
|
+ android:fragment="org.chromium.chrome.browser.browsing_data.ClearBrowsingDataFragmentAtStart" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="close_tabs_on_exit"
|
|
+ android:title="@string/close_tabs_on_exit_title"
|
|
+ android:summary="@string/close_tabs_on_exit_summary"
|
|
+ android:defaultValue="false" />
|
|
+ <org.chromium.components.browser_ui.settings.SpinnerPreference
|
|
+ android:key="history_expire_days_threshold"
|
|
+ android:persistent="false"
|
|
+ android:title="@string/history_expire_days_threshold_title"
|
|
+ android:summary="@string/history_expire_days_threshold_summary"
|
|
+ app:singleLine="true" />
|
|
+
|
|
+ <PreferenceCategory
|
|
+ android:title="@string/data_exposed_to_website_section_title"/>
|
|
+ <org.chromium.components.browser_ui.settings.ChromeBasePreference
|
|
+ android:key="third_party_cookies"
|
|
+ android:title="@string/third_party_cookies_link_row_label"
|
|
+ android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings" />
|
|
+ <Preference
|
|
+ android:key="do_not_track"
|
|
+ android:title="@string/do_not_track_title"
|
|
+ android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings" />
|
|
+ <Preference
|
|
+ android:key="gpc"
|
|
+ android:title="@string/gpc_title"
|
|
+ android:fragment="org.chromium.chrome.browser.privacy.settings.GpcSettings" />
|
|
+ <Preference
|
|
+ android:key="referers_policy"
|
|
+ android:title="@string/referers_policy_title"
|
|
+ android:fragment="org.chromium.chrome.browser.privacy.settings.RefererSettingsFragment"/>
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="can_make_payment"
|
|
+ android:title="@string/can_make_payment_title"
|
|
+ android:summary="@string/settings_can_make_payment_toggle_label" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="throttle_main_thread_to_60hz"
|
|
+ android:title="@string/throttle_main_thread_to_60hz_title"
|
|
+ android:summary="@string/throttle_main_thread_to_60hz_summary"
|
|
+ app:featureName="throttle-main-thread-to-60hz"
|
|
+ app:needRestart="true" />
|
|
+
|
|
+ <PreferenceCategory
|
|
+ android:title="@string/data_exposed_to_device_section_title"/>
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="allow_custom_tab_intents"
|
|
+ android:title="@string/allow_custom_tab_intents_title"
|
|
+ android:summary="@string/allow_custom_tab_intents_summary"
|
|
+ android:defaultValue="false" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:title="@string/uses_separate_storagepartition_for_cct_title"
|
|
+ android:summary="@string/uses_separate_storagepartition_for_cct_summary"
|
|
+ app:featureName="maylaunchurl-uses-separate-storage-partition"
|
|
+ app:needRestart="true" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="allow_external_intent_requests"
|
|
+ android:title="@string/allow_external_intent_requests_title"
|
|
+ android:summary="@string/allow_external_intent_requests_summary"
|
|
+ app:featureName="AllowExternalIntentRequests"
|
|
+ app:needRestart="false" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="use_tab_switcher_list_mode"
|
|
+ android:title="@string/tab_switcher_list_mode_title"
|
|
+ android:summary="@string/tab_switcher_list_mode_summary"
|
|
+ app:featureName="TabSwitcherListMode"
|
|
+ app:needRestart="true" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="tabgrid_use_icons"
|
|
+ android:title="@string/tabgrid_use_icons_title"
|
|
+ android:summary="@string/tabgrid_use_icons_summary"
|
|
+ android:defaultValue="false" />
|
|
+
|
|
+ <PreferenceCategory
|
|
+ android:title="@string/incognito_related_section_title"/>
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="open_external_links_incognito"
|
|
+ android:title="@string/open_external_links_incognito_title"
|
|
+ android:summary="@string/open_external_links_incognito_summary"
|
|
+ android:defaultValue="false" />
|
|
+ <org.chromium.chrome.browser.incognito.reauth.IncognitoReauthSettingSwitchPreference
|
|
+ android:key="incognito_lock"
|
|
+ android:title="@string/settings_incognito_tab_lock_title"
|
|
+ android:summary="@string/settings_incognito_tab_lock_summary_android_setting_off"
|
|
+ android:persistent="false" />
|
|
+ <Preference
|
|
+ android:key="incognito_settings"
|
|
+ android:title="@string/incognito_settings_title"
|
|
+ android:summary="@string/incognito_settings_summary"
|
|
+ android:fragment="org.chromium.chrome.browser.privacy.settings.IncognitoSettings"/>
|
|
+
|
|
+ <PreferenceCategory
|
|
+ android:key="security_section"
|
|
+ android:title="@string/security_section_title"/>
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="https_first_mode_legacy"
|
|
+ android:title="@string/settings_https_first_mode_title"
|
|
+ android:summary="@string/settings_https_first_mode_summary" />
|
|
+ <Preference
|
|
+ android:key="https_first_mode"
|
|
+ android:title="@string/settings_https_first_mode_title"
|
|
+ android:fragment="org.chromium.chrome.browser.ssl.HttpsFirstModeSettingsFragment" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeBasePreference
|
|
+ android:key="secure_dns"
|
|
+ android:title="@string/settings_secure_dns_title"
|
|
+ android:fragment="org.chromium.chrome.browser.privacy.secure_dns.SecureDnsSettings" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:title="@string/dangling_pointer_detector_title"
|
|
+ android:summary="@string/dangling_pointer_detector_summary"
|
|
+ app:featureName="enable-dangling-pointer-detector"
|
|
+ app:needRestart="true" />
|
|
+
|
|
+ <PreferenceCategory
|
|
+ android:title="@string/services_category_title"/>
|
|
+ <org.chromium.chrome.browser.about_settings.HyperlinkPreference
|
|
+ android:key="proxy"
|
|
+ android:title="@string/proxy_title"
|
|
+ app:url="@string/proxy_url" />
|
|
+ <org.chromium.chrome.browser.about_settings.HyperlinkPreference
|
|
+ android:key="cromite_flags"
|
|
+ android:title="@string/cromite_flags_title"
|
|
+ app:url="@string/cromite_flags_url" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
|
+ android:key="search_suggestions"
|
|
+ android:title="@string/improve_search_suggestions_title"
|
|
+ android:summary="@string/improve_search_suggestions_summary"
|
|
+ android:persistent="false"/>
|
|
+
|
|
+ <!--Always hidden-->
|
|
+ <org.chromium.chrome.browser.safety_hub.SafetyHubExpandablePreference
|
|
+ android:key="advanced_protection_info"
|
|
+ android:title="@string/settings_privacy_and_security_advanced_protection_section_title"
|
|
+ app:isPreferenceVisible="false" />
|
|
+ <Preference
|
|
+ android:key="safe_browsing"
|
|
+ android:title="@string/prefs_safe_browsing_title"
|
|
+ android:summary="@string/prefs_safe_browsing_summary"
|
|
+ android:fragment="org.chromium.chrome.browser.safe_browsing.settings.SafeBrowsingSettingsFragment"
|
|
+ app:isPreferenceVisible="false" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeBasePreference
|
|
+ android:key="contextual_search"
|
|
+ android:title="@string/contextual_search_title"
|
|
+ android:fragment="org.chromium.chrome.browser.contextualsearch.ContextualSearchSettingsFragment"
|
|
+ app:isPreferenceVisible="false" />
|
|
+ <Preference
|
|
+ android:key="privacy_guide"
|
|
+ app:isPreferenceVisible="false"
|
|
+ android:title="@string/privacy_guide_pref_title"
|
|
+ android:summary="@string/privacy_guide_pref_summary"
|
|
+ android:fragment="org.chromium.chrome.browser.privacy_guide.PrivacyGuideFragment" />
|
|
+ <Preference
|
|
+ android:key="tracking_protection"
|
|
+ android:title="@string/third_party_cookies_link_row_label"
|
|
+ android:fragment="org.chromium.components.privacy_sandbox.TrackingProtectionSettings"
|
|
+ app:isPreferenceVisible="false" />
|
|
+ <Preference
|
|
+ android:key="privacy_sandbox"
|
|
+ android:title="@string/ad_privacy_link_row_label"
|
|
+ android:summary="@string/ad_privacy_link_row_sub_label"
|
|
+ android:fragment="org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxSettingsFragment" />
|
|
+ <Preference
|
|
+ android:key="preload_pages"
|
|
+ android:title="@string/preload_pages_title"
|
|
+ android:summary="@string/preload_pages_summary"
|
|
+ android:fragment="org.chromium.chrome.browser.prefetch.settings.PreloadPagesSettingsFragment"
|
|
+ app:isPreferenceVisible="false" />
|
|
+ <org.chromium.components.browser_ui.settings.TextMessagePreference
|
|
+ android:key="sync_and_services_link"
|
|
+ android:summary="@string/privacy_sync_and_services_link_legacy"
|
|
+ app:allowDividerBelow="false"
|
|
+ app:isPreferenceVisible="false" />
|
|
+ <org.chromium.components.browser_ui.settings.ChromeBasePreference
|
|
+ android:key="javascript_optimizer"
|
|
+ android:title="@string/website_settings_privacy_and_security_javascript_optimizer_row_label"
|
|
+ android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
|
|
+ app:isPreferenceVisible="false" />
|
|
+</PreferenceScreen>
|
|
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
|
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
|
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
|
@@ -204,7 +204,7 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
|
public void onCreatePreferencesCromite(@Nullable Bundle savedInstanceState, @Nullable String rootKey) {
|
|
mPageTitle.set(getString(R.string.prefs_privacy_security));
|
|
|
|
- SettingsUtils.addPreferencesFromResource(this, R.xml.privacy_preferences);
|
|
+ SettingsUtils.addPreferencesFromResource(this, R.xml.privacy_preferences_cromite);
|
|
|
|
Preference sandboxPreference = findPreference(PREF_PRIVACY_SANDBOX);
|
|
// Overwrite the click listener to pass a correct referrer to the fragment.
|
|
@@ -291,7 +291,9 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
|
|
|
ChromeSwitchPreference passwordLeakTogglePref =
|
|
(ChromeSwitchPreference) findPreference(PREF_PASSWORD_LEAK_DETECTION);
|
|
- passwordLeakTogglePref.setOnPreferenceChangeListener(this);
|
|
+ if (passwordLeakTogglePref != null) {
|
|
+ passwordLeakTogglePref.setVisible(false);
|
|
+ }
|
|
|
|
mSearchSuggestions = (ChromeSwitchPreference) findPreference(PREF_SEARCH_SUGGESTIONS);
|
|
mSearchSuggestions.setOnPreferenceChangeListener(this);
|
|
diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Cromite-settings-ui.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Cromite-settings-ui.grdp
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Cromite-settings-ui.grdp
|
|
@@ -0,0 +1,15 @@
|
|
+<?xml version="1.0" encoding="utf-8"?>
|
|
+<grit-part>
|
|
+ <message name="IDS_BROWSING_DATA_SECTION_TITLE" desc="">
|
|
+ Browsing data
|
|
+ </message>
|
|
+ <message name="IDS_DATA_EXPOSED_TO_WEBSITE_SECTION_TITLE" desc="">
|
|
+ Data exposed to the websites
|
|
+ </message>
|
|
+ <message name="IDS_INCOGNITO_RELATED_SECTION_TITLE" desc="">
|
|
+ Incognito mode
|
|
+ </message>
|
|
+ <message name="IDS_DATA_EXPOSED_TO_DEVICE_SECTION_TITLE" desc="">
|
|
+ Data exposed in the device
|
|
+ </message>
|
|
+</grit-part>
|
|
--
|