Commit 7b6282d1 authored by Xinghui Lu's avatar Xinghui Lu Committed by Commit Bot

[Android] Create a "Security" section in settings behind a flag.

Add a flag named "SafeBrowsingSecuritySectionUIAndroid". When this
flag is enabled:

* Remove the Safe Browsing, data breach and Scout settings from
SyncAndServicesSettings. They will be moved under the new "Security"
section.
before: http://screen/sqZdYYgeTui
after: http://screen/WomGjbCwT14

* Add a "Security" section under the "Privacy" section.
before: http://screen/Knonxg95erZ
after: http://screen/EsXPyntvkpV

* Rename the "Privacy" section to "Privacy and security" section.
before: http://screen/U75bT4sDFmJ
after: http://screen/DuqDjmmR1x0

More context can be found in go/esb-clank-dd.

Bug: 1097310
Change-Id: I7644167ff36741a8a39feaa269704904ae6c73ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2275343Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarNatalie Chouinard <chouinard@chromium.org>
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786561}
parent e12ea56d
......@@ -32,6 +32,11 @@
android:title="@string/clear_browsing_data_title"
android:summary="@string/clear_browsing_data_summary"
android:fragment="org.chromium.chrome.browser.browsing_data.ClearBrowsingDataTabsFragment" />
<Preference
android:key="security"
android:title="@string/prefs_security_title"
android:summary="@string/prefs_security_summary"
android:fragment="org.chromium.chrome.browser.safe_browsing.settings.SecuritySettingsFragment" />
<org.chromium.components.browser_ui.settings.TextMessagePreference
android:key="sync_and_services_link"
android:summary="@string/privacy_sync_and_services_link"
......
......@@ -16,6 +16,7 @@ import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
import org.chromium.base.BuildInfo;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.help.HelpAndFeedback;
import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.browser.privacy.settings.PrivacyPreferencesManager.DohEntry;
......@@ -46,6 +47,7 @@ public class PrivacySettings
private static final String PREF_SECURE_DNS = "secure_dns";
private static final String PREF_USAGE_STATS = "usage_stats_reporting";
private static final String PREF_DO_NOT_TRACK = "do_not_track";
private static final String PREF_SECURITY = "security";
private static final String PREF_SYNC_AND_SERVICES_LINK = "sync_and_services_link";
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
......@@ -55,7 +57,16 @@ public class PrivacySettings
PrivacyPreferencesManager privacyPrefManager = PrivacyPreferencesManager.getInstance();
privacyPrefManager.migrateNetworkPredictionPreferences();
SettingsUtils.addPreferencesFromResource(this, R.xml.privacy_preferences);
getActivity().setTitle(R.string.prefs_privacy);
// If the flag for adding a "Security" section UI is enabled, a "Security" section will be
// added under this section and this section will be renamed to "Privacy and security".
// See (go/esb-clank-dd) for more context.
if (ChromeFeatureList.isEnabled(ChromeFeatureList.SAFE_BROWSING_SECURITY_SECTION_UI)) {
getActivity().setTitle(R.string.prefs_privacy_security);
} else {
getActivity().setTitle(R.string.prefs_privacy);
getPreferenceScreen().removePreference(findPreference(PREF_SECURITY));
}
setHasOptionsMenu(true);
mManagedPreferenceDelegate = createManagedPreferenceDelegate();
......
......@@ -144,6 +144,13 @@ public class MainSettings extends PreferenceFragmentCompat
getPreferenceScreen().addPreference(homepagePreference);
}
// If the flag for adding a "Security" section is enabled, the "Privacy" section will be
// renamed to a "Privacy and security" section and the "Security" section will be added
// under the renamed section. See (go/esb-clank-dd) for more context.
if (ChromeFeatureList.isEnabled(ChromeFeatureList.SAFE_BROWSING_SECURITY_SECTION_UI)) {
findPreference(PREF_PRIVACY).setTitle(R.string.prefs_privacy_security);
}
cachePreferences();
mSignInPreference.setOnStateChangedCallback(this::onSignInPreferenceStateChanged);
......
......@@ -62,14 +62,16 @@ public class GoogleServicesSettings
private ChromeSwitchPreference mSearchSuggestions;
private ChromeSwitchPreference mNavigationError;
private ChromeSwitchPreference mSafeBrowsing;
private ChromeSwitchPreference mPasswordLeakDetection;
private ChromeSwitchPreference mSafeBrowsingReporting;
private @Nullable ChromeSwitchPreference mSafeBrowsing;
private @Nullable ChromeSwitchPreference mPasswordLeakDetection;
private @Nullable ChromeSwitchPreference mSafeBrowsingReporting;
private ChromeSwitchPreference mUsageAndCrashReporting;
private ChromeSwitchPreference mUrlKeyedAnonymizedData;
private @Nullable ChromeSwitchPreference mAutofillAssistant;
private @Nullable Preference mContextualSearch;
private boolean mIsSecurityPreferenceRemoved = false;
@Override
public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) {
mPrivacyPrefManager.migrateNetworkPredictionPreferences();
......@@ -87,19 +89,33 @@ public class GoogleServicesSettings
mNavigationError.setOnPreferenceChangeListener(this);
mNavigationError.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mSafeBrowsing = (ChromeSwitchPreference) findPreference(PREF_SAFE_BROWSING);
mSafeBrowsing.setOnPreferenceChangeListener(this);
mSafeBrowsing.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mPasswordLeakDetection =
(ChromeSwitchPreference) findPreference(PREF_PASSWORD_LEAK_DETECTION);
mPasswordLeakDetection.setOnPreferenceChangeListener(this);
mPasswordLeakDetection.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mSafeBrowsingReporting =
(ChromeSwitchPreference) findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING);
mSafeBrowsingReporting.setOnPreferenceChangeListener(this);
mSafeBrowsingReporting.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
// If security section UI is enabled, Safe Browsing related preferences will be moved to a
// dedicated "Security" preference page.
mIsSecurityPreferenceRemoved =
ChromeFeatureList.isEnabled(ChromeFeatureList.SAFE_BROWSING_SECURITY_SECTION_UI);
if (mIsSecurityPreferenceRemoved) {
removePreference(getPreferenceScreen(), findPreference(PREF_SAFE_BROWSING));
removePreference(getPreferenceScreen(), findPreference(PREF_PASSWORD_LEAK_DETECTION));
removePreference(
getPreferenceScreen(), findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING));
mSafeBrowsing = null;
mPasswordLeakDetection = null;
mSafeBrowsingReporting = null;
} else {
mSafeBrowsing = (ChromeSwitchPreference) findPreference(PREF_SAFE_BROWSING);
mSafeBrowsing.setOnPreferenceChangeListener(this);
mSafeBrowsing.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mPasswordLeakDetection =
(ChromeSwitchPreference) findPreference(PREF_PASSWORD_LEAK_DETECTION);
mPasswordLeakDetection.setOnPreferenceChangeListener(this);
mPasswordLeakDetection.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mSafeBrowsingReporting =
(ChromeSwitchPreference) findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING);
mSafeBrowsingReporting.setOnPreferenceChangeListener(this);
mSafeBrowsingReporting.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
}
mUsageAndCrashReporting =
(ChromeSwitchPreference) findPreference(PREF_USAGE_AND_CRASH_REPORTING);
......@@ -159,14 +175,17 @@ public class GoogleServicesSettings
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
} else if (PREF_SAFE_BROWSING.equals(key)) {
assert !mIsSecurityPreferenceRemoved;
mPrefServiceBridge.setBoolean(Pref.SAFE_BROWSING_ENABLED, (boolean) newValue);
// Toggling the safe browsing preference impacts the leak detection and the
// safe browsing reporting preferences as well.
PostTask.postTask(UiThreadTaskTraits.DEFAULT,
this::updateLeakDetectionAndSafeBrowsingReportingPreferences);
} else if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
assert !mIsSecurityPreferenceRemoved;
mPrefServiceBridge.setBoolean(Pref.PASSWORD_LEAK_DETECTION_ENABLED, (boolean) newValue);
} else if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
assert !mIsSecurityPreferenceRemoved;
SafeBrowsingBridge.setSafeBrowsingExtendedReportingEnabled((boolean) newValue);
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED, (boolean) newValue);
......@@ -190,9 +209,10 @@ public class GoogleServicesSettings
mSearchSuggestions.setChecked(mPrefServiceBridge.getBoolean(Pref.SEARCH_SUGGEST_ENABLED));
mNavigationError.setChecked(
mPrefServiceBridge.getBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED));
mSafeBrowsing.setChecked(mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED));
updateLeakDetectionAndSafeBrowsingReportingPreferences();
if (!mIsSecurityPreferenceRemoved) {
mSafeBrowsing.setChecked(mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED));
updateLeakDetectionAndSafeBrowsingReportingPreferences();
}
mUsageAndCrashReporting.setChecked(
mPrivacyPrefManager.isUsageAndCrashReportingPermittedByUser());
......@@ -216,6 +236,7 @@ public class GoogleServicesSettings
* its appearance needs to be updated. The same goes for safe browsing reporting.
*/
private void updateLeakDetectionAndSafeBrowsingReportingPreferences() {
assert !mIsSecurityPreferenceRemoved;
boolean safe_browsing_enabled = mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED);
mSafeBrowsingReporting.setEnabled(safe_browsing_enabled);
mSafeBrowsingReporting.setChecked(safe_browsing_enabled
......
......@@ -103,10 +103,12 @@ public class SyncAndServicesSettings extends PreferenceFragmentCompat
private static final String PREF_SERVICES_CATEGORY = "services_category";
private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions";
private static final String PREF_NAVIGATION_ERROR = "navigation_error";
private static final String PREF_SAFE_BROWSING = "safe_browsing";
private static final String PREF_PASSWORD_LEAK_DETECTION = "password_leak_detection";
private static final String PREF_SAFE_BROWSING_SCOUT_REPORTING =
"safe_browsing_scout_reporting";
@VisibleForTesting
public static final String PREF_SAFE_BROWSING = "safe_browsing";
@VisibleForTesting
public static final String PREF_PASSWORD_LEAK_DETECTION = "password_leak_detection";
@VisibleForTesting
public static final String PREF_SAFE_BROWSING_SCOUT_REPORTING = "safe_browsing_scout_reporting";
private static final String PREF_USAGE_AND_CRASH_REPORTING = "usage_and_crash_reports";
private static final String PREF_URL_KEYED_ANONYMIZED_DATA = "url_keyed_anonymized_data";
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
......@@ -137,9 +139,9 @@ public class SyncAndServicesSettings extends PreferenceFragmentCompat
private ChromeSwitchPreference mSearchSuggestions;
private ChromeSwitchPreference mNavigationError;
private ChromeSwitchPreference mSafeBrowsing;
private ChromeSwitchPreference mPasswordLeakDetection;
private ChromeSwitchPreference mSafeBrowsingReporting;
private @Nullable ChromeSwitchPreference mSafeBrowsing;
private @Nullable ChromeSwitchPreference mPasswordLeakDetection;
private @Nullable ChromeSwitchPreference mSafeBrowsingReporting;
private ChromeSwitchPreference mUsageAndCrashReporting;
private ChromeSwitchPreference mUrlKeyedAnonymizedData;
private @Nullable ChromeSwitchPreference mAutofillAssistant;
......@@ -149,6 +151,8 @@ public class SyncAndServicesSettings extends PreferenceFragmentCompat
private @SyncError int mCurrentSyncError = SyncError.NO_ERROR;
private boolean mIsSecurityPreferenceRemoved = false;
/**
* Creates an argument bundle for this fragment.
* @param isFromSigninScreen Whether the screen is started from the sign-in screen.
......@@ -205,21 +209,35 @@ public class SyncAndServicesSettings extends PreferenceFragmentCompat
mNavigationError.setOnPreferenceChangeListener(this);
mNavigationError.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mSafeBrowsing = (ChromeSwitchPreference) findPreference(PREF_SAFE_BROWSING);
mSafeBrowsing.setOnPreferenceChangeListener(this);
mSafeBrowsing.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
PreferenceCategory servicesCategory =
(PreferenceCategory) findPreference(PREF_SERVICES_CATEGORY);
mPasswordLeakDetection =
(ChromeSwitchPreference) findPreference(PREF_PASSWORD_LEAK_DETECTION);
mPasswordLeakDetection.setOnPreferenceChangeListener(this);
mPasswordLeakDetection.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mSafeBrowsingReporting =
(ChromeSwitchPreference) findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING);
mSafeBrowsingReporting.setOnPreferenceChangeListener(this);
mSafeBrowsingReporting.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
// If security section UI is enabled, Safe Browsing related preferences will be moved to a
// dedicated "Security" preference page.
mIsSecurityPreferenceRemoved =
ChromeFeatureList.isEnabled(ChromeFeatureList.SAFE_BROWSING_SECURITY_SECTION_UI);
if (mIsSecurityPreferenceRemoved) {
removePreference(servicesCategory, findPreference(PREF_SAFE_BROWSING));
removePreference(servicesCategory, findPreference(PREF_PASSWORD_LEAK_DETECTION));
removePreference(servicesCategory, findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING));
mSafeBrowsing = null;
mPasswordLeakDetection = null;
mSafeBrowsingReporting = null;
} else {
mSafeBrowsing = (ChromeSwitchPreference) findPreference(PREF_SAFE_BROWSING);
mSafeBrowsing.setOnPreferenceChangeListener(this);
mSafeBrowsing.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mPasswordLeakDetection =
(ChromeSwitchPreference) findPreference(PREF_PASSWORD_LEAK_DETECTION);
mPasswordLeakDetection.setOnPreferenceChangeListener(this);
mPasswordLeakDetection.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
mSafeBrowsingReporting =
(ChromeSwitchPreference) findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING);
mSafeBrowsingReporting.setOnPreferenceChangeListener(this);
mSafeBrowsingReporting.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
}
mUsageAndCrashReporting =
(ChromeSwitchPreference) findPreference(PREF_USAGE_AND_CRASH_REPORTING);
......@@ -361,14 +379,17 @@ public class SyncAndServicesSettings extends PreferenceFragmentCompat
} else if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
} else if (PREF_SAFE_BROWSING.equals(key)) {
assert !mIsSecurityPreferenceRemoved;
mPrefServiceBridge.setBoolean(Pref.SAFE_BROWSING_ENABLED, (boolean) newValue);
// Toggling the safe browsing preference impacts the leak detection and the
// safe browsing reporting preferences as well.
PostTask.postTask(UiThreadTaskTraits.DEFAULT,
this::updateLeakDetectionAndSafeBrowsingReportingPreferences);
} else if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
assert !mIsSecurityPreferenceRemoved;
mPrefServiceBridge.setBoolean(Pref.PASSWORD_LEAK_DETECTION_ENABLED, (boolean) newValue);
} else if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
assert !mIsSecurityPreferenceRemoved;
SafeBrowsingBridge.setSafeBrowsingExtendedReportingEnabled((boolean) newValue);
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED, (boolean) newValue);
......@@ -551,9 +572,10 @@ public class SyncAndServicesSettings extends PreferenceFragmentCompat
mSearchSuggestions.setChecked(mPrefServiceBridge.getBoolean(Pref.SEARCH_SUGGEST_ENABLED));
mNavigationError.setChecked(
mPrefServiceBridge.getBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED));
mSafeBrowsing.setChecked(mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED));
updateLeakDetectionAndSafeBrowsingReportingPreferences();
if (!mIsSecurityPreferenceRemoved) {
mSafeBrowsing.setChecked(mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED));
updateLeakDetectionAndSafeBrowsingReportingPreferences();
}
mUsageAndCrashReporting.setChecked(
mPrivacyPrefManager.isUsageAndCrashReportingPermittedByUser());
......@@ -623,6 +645,7 @@ public class SyncAndServicesSettings extends PreferenceFragmentCompat
* its appearance needs to be updated. The same goes for safe browsing reporting.
*/
private void updateLeakDetectionAndSafeBrowsingReportingPreferences() {
assert !mIsSecurityPreferenceRemoved;
boolean safe_browsing_enabled = mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED);
mSafeBrowsingReporting.setEnabled(safe_browsing_enabled);
mSafeBrowsingReporting.setChecked(safe_browsing_enabled
......
......@@ -177,6 +177,16 @@ public class MainSettingsFragmentTest {
assertSettingsExists(MainSettings.PREF_SAFETY_CHECK, SafetyCheckSettingsFragment.class);
}
@Test
@SmallTest
@EnableFeatures(ChromeFeatureList.SAFE_BROWSING_SECURITY_SECTION_UI)
public void testSafeBrowsingSecuritySectionUiFlagOn() {
launchSettingsActivity();
assertSettingsExists(MainSettings.PREF_PRIVACY, PrivacySettings.class);
Assert.assertEquals(mMainSettings.getString(R.string.prefs_privacy_security),
mMainSettings.findPreference(MainSettings.PREF_PRIVACY).getTitle().toString());
}
@Test
@SmallTest
public void testHomepageOff() {
......
......@@ -340,6 +340,28 @@ public class SyncAndServicesSettingsTest {
});
}
@Test
@LargeTest
@Feature({"Preference"})
@EnableFeatures(ChromeFeatureList.SAFE_BROWSING_SECURITY_SECTION_UI)
public void testSafeBrowsingSecuritySectionUiFlagOn() {
final SyncAndServicesSettings syncAndServicesSettings = startSyncAndServicesPreferences();
TestThreadUtils.runOnUiThreadBlocking(() -> {
Assert.assertNull("Safe Browsing should be null when security section is enabled.",
syncAndServicesSettings.findPreference(
SyncAndServicesSettings.PREF_SAFE_BROWSING));
Assert.assertNull(
"Password leak detection should be null when security section is enabled.",
syncAndServicesSettings.findPreference(
SyncAndServicesSettings.PREF_PASSWORD_LEAK_DETECTION));
Assert.assertNull(
"Safe Browsing scout should be null when security section is enabled.",
syncAndServicesSettings.findPreference(
SyncAndServicesSettings.PREF_SAFE_BROWSING_SCOUT_REPORTING));
});
}
private void setAutofillAssistantSwitchValue(boolean newValue) {
SharedPreferencesManager.getInstance().writeBoolean(
ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED, newValue);
......
......@@ -251,6 +251,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&query_tiles::features::kQueryTiles,
&query_tiles::features::kQueryTilesInOmnibox,
&query_tiles::features::kQueryTilesEnableQueryEditing,
&safe_browsing::kSafeBrowsingSecuritySectionUIAndroid,
&security_state::features::kMarkHttpAsFeature,
&signin::kMobileIdentityConsistency,
&switches::kSyncUseSessionsUnregisterDelay,
......
......@@ -377,6 +377,8 @@ public abstract class ChromeFeatureList {
public static final String REPORT_FEED_USER_ACTIONS = "ReportFeedUserActions";
public static final String REVAMPED_CONTEXT_MENU = "RevampedContextMenu";
public static final String SAFETY_CHECK_ANDROID = "SafetyCheckAndroid";
public static final String SAFE_BROWSING_SECURITY_SECTION_UI =
"SafeBrowsingSecuritySectionUIAndroid";
public static final String SAME_SITE_BY_DEFAULT_COOKIES = "SameSiteByDefaultCookies";
public static final String SEND_TAB_TO_SELF = "SyncSendTabToSelf";
public static final String SERVICE_MANAGER_FOR_DOWNLOAD = "ServiceManagerForDownload";
......
......@@ -19,10 +19,27 @@ source_set("android") {
}
android_library("java") {
sources = [ "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java" ]
sources = [
"java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java",
"java/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragment.java",
]
deps = [
":java_resources",
"//base:base_java",
"//base:jni_java",
"//components/browser_ui/settings/android:java",
"//third_party/android_deps:androidx_fragment_fragment_java",
"//third_party/android_deps:androidx_preference_preference_java",
"//ui/android:ui_full_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
android_resources("java_resources") {
sources = [ "java/res/xml/security_preferences.xml" ]
deps = [
"//chrome/browser/ui/android/strings:ui_strings_grd",
"//components/browser_ui/settings/android:java_resources",
]
custom_package = "org.chromium.chrome.browser.safe_browsing.settings"
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2020 The Chromium Authors. All rights reserved.
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"
android:orderingFromXml="false">
<PreferenceCategory
android:key="safe_browsing_section"
android:title="@string/prefs_section_safe_browsing_title"/>
<!-- TODO(crbug.com/1097310): Add Safe Browsing Radio Button Group -->
</PreferenceScreen>
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.safe_browsing.settings;
import android.os.Bundle;
import androidx.preference.PreferenceFragmentCompat;
import org.chromium.components.browser_ui.settings.SettingsUtils;
/**
* Fragment containing security settings.
*/
public class SecuritySettingsFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle bundle, String s) {
SettingsUtils.addPreferencesFromResource(this, R.xml.security_preferences);
getActivity().setTitle(R.string.prefs_security_title);
}
}
......@@ -681,6 +681,9 @@ CHAR-LIMIT guidelines:
<message name="IDS_PREFS_PRIVACY" desc="Title for the Privacy preferences. [CHAR-LIMIT=32]">
Privacy
</message>
<message name="IDS_PREFS_PRIVACY_SECURITY" desc="Title for the Privacy and Security preferences. [CHAR-LIMIT=32]">
Privacy and security
</message>
<message name="IDS_SAFE_BROWSING_SCOUT_REPORTING_TITLE" desc="Title for checkbox that controls reporting data to detect bad apps/sites. Please ensure ‘Safe Browsing’ in this message matches the ‘Safe Browsing’ settings title.">
Help improve Chrome security
</message>
......@@ -926,6 +929,17 @@ Your Google account may have other forms of browsing history like searches and a
Chrome could not check for updates
</message>
<!-- Security preferences -->
<message name="IDS_PREFS_SECURITY_TITLE" desc="Title for the Security preferences. [CHAR-LIMIT=32]">
Security
</message>
<message name="IDS_PREFS_SECURITY_SUMMARY" desc="Summary for the Security preferences.">
Safe Browsing (protection from dangerous sites) and other security settings
</message>
<message name="IDS_PREFS_SECTION_SAFE_BROWSING_TITLE" desc="Title for the Safe Browsing section. [CHAR-LIMIT=32]">
Safe Browsing
</message>
<!-- Accessibility preferences -->
<message name="IDS_PREFS_ACCESSIBILITY" desc="Title of Accessibility settings, which allows the user to change webpage font sizes. [CHAR-LIMIT=32]">
Accessibility
......
c08bf9b819b8afc8d238cd2f8c91903fbe732a02
\ No newline at end of file
9815840a4b7ca1e6aae354ce2595bf1cf6ee79d0
\ No newline at end of file
9815840a4b7ca1e6aae354ce2595bf1cf6ee79d0
\ No newline at end of file
......@@ -116,6 +116,9 @@ const base::Feature kSafeBrowsingSeparateNetworkContexts{
constexpr base::FeatureParam<bool> kShouldFillOldPhishGuardProto{
&kPasswordProtectionForSignedInUsers, "DeprecateOldProto", false};
const base::Feature kSafeBrowsingSecuritySectionUIAndroid{
"SafeBrowsingSecuritySectionUIAndroid", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kSuspiciousSiteTriggerQuotaFeature{
"SafeBrowsingSuspiciousSiteTriggerQuota", base::FEATURE_ENABLED_BY_DEFAULT};
......@@ -159,6 +162,7 @@ constexpr struct {
{&kRealTimeUrlLookupNonMainframeEnabledForEP, true},
{&kSafeBrowsingAvailableOnIOS, true},
{&kSafeBrowsingSeparateNetworkContexts, true},
{&kSafeBrowsingSecuritySectionUIAndroid, true},
{&kSuspiciousSiteTriggerQuotaFeature, true},
{&kThreatDomDetailsTagAndAttributeFeature, false},
{&kTriggerThrottlerDailyQuotaFeature, false},
......
......@@ -74,6 +74,9 @@ extern const base::Feature kSafeBrowsingAvailableOnIOS;
// profile.
extern const base::Feature kSafeBrowsingSeparateNetworkContexts;
// Controls whether the security section is shown on the settings UI on Android.
extern const base::Feature kSafeBrowsingSecuritySectionUIAndroid;
// Controls the daily quota for the suspicious site trigger.
extern const base::Feature kSuspiciousSiteTriggerQuotaFeature;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment