Commit 30a22dd5 authored by Xinghui Lu's avatar Xinghui Lu Committed by Commit Bot

Return early if Safe Browsing state isn't changed.

Bug: 1097310
Change-Id: Iac117bddb711cbd493c05e8a86a40ca8d00f0130
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353090Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797381}
parent e8a14970
......@@ -118,10 +118,12 @@ public class SecuritySettingsFragment extends PreferenceFragmentCompat
int newState = (int) newValue;
@SafeBrowsingState
int currentState = SafeBrowsingBridge.getSafeBrowsingState();
if (newState == currentState) {
return true;
}
// If the user selects no protection from another Safe Browsing state, show a confirmation
// dialog to double check if they want to select no protection.
if (newState == SafeBrowsingState.NO_SAFE_BROWSING
&& currentState != SafeBrowsingState.NO_SAFE_BROWSING) {
if (newState == SafeBrowsingState.NO_SAFE_BROWSING) {
// The user hasn't confirmed to select no protection, keep the radio button / UI checked
// state at the currently selected level.
mSafeBrowsingPreference.setCheckedState(currentState);
......
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