Commit b13bfffa authored by Rainhard Findling's avatar Rainhard Findling Committed by Commit Bot

Safety check UI: distinguish standard and enhanced SB

* Deprecate the |ENABLED| SB state in safety check and use
  |ENABLED_STANDARD| and |ENABLED_ENHANCED| states instead.
* This CL updates the JS side of safety check. The C++ side is
  updated in crrev.com/c/2141983.

Bug: 1015841
Change-Id: I24388fec9060eebe43dbfb7f537dd88080560fec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2148735Reviewed-by: default avatarAndrey Zaytsev <andzaytsev@google.com>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Rainhard Findling <rainhard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759626}
parent cdea1579
......@@ -67,10 +67,13 @@ cr.define('settings', function() {
*/
/* #export */ const SafetyCheckSafeBrowsingStatus = {
CHECKING: 0,
// Enabled is deprecated; kept not to break old UMA metrics (enums.xml).
ENABLED: 1,
DISABLED: 2,
DISABLED_BY_ADMIN: 3,
DISABLED_BY_EXTENSION: 4,
ENABLED_STANDARD: 5,
ENABLED_ENHANCED: 6,
};
/**
......
......@@ -606,8 +606,12 @@ Polymer({
switch (this.safeBrowsingStatus_) {
case settings.SafetyCheckSafeBrowsingStatus.CHECKING:
return ChildUiStatus.RUNNING;
case settings.SafetyCheckSafeBrowsingStatus.ENABLED:
case settings.SafetyCheckSafeBrowsingStatus.ENABLED_STANDARD:
case settings.SafetyCheckSafeBrowsingStatus.ENABLED_ENHANCED:
return ChildUiStatus.SAFE;
case settings.SafetyCheckSafeBrowsingStatus.ENABLED:
// ENABLED is deprecated.
assertNotReached();
case settings.SafetyCheckSafeBrowsingStatus.DISABLED:
case settings.SafetyCheckSafeBrowsingStatus.DISABLED_BY_ADMIN:
case settings.SafetyCheckSafeBrowsingStatus.DISABLED_BY_EXTENSION:
......
......@@ -156,7 +156,7 @@ suite('SafetyCheckUiTests', function() {
fireSafetyCheckUpdatesEvent(settings.SafetyCheckUpdatesStatus.UPDATED);
fireSafetyCheckPasswordsEvent(settings.SafetyCheckPasswordsStatus.SAFE);
fireSafetyCheckSafeBrowsingEvent(
settings.SafetyCheckSafeBrowsingStatus.ENABLED);
settings.SafetyCheckSafeBrowsingStatus.ENABLED_STANDARD);
fireSafetyCheckExtensionsEvent(
settings.SafetyCheckExtensionsStatus.NO_BLOCKLISTED_EXTENSIONS);
......@@ -337,9 +337,18 @@ suite('SafetyCheckUiTests', function() {
assertIconStatusRunning(page.$$('#safeBrowsingIcon'));
});
test('safeBrowsingEnabledUiTest', function() {
test('safeBrowsingEnabledStandardUiTest', function() {
fireSafetyCheckSafeBrowsingEvent(
settings.SafetyCheckSafeBrowsingStatus.ENABLED);
settings.SafetyCheckSafeBrowsingStatus.ENABLED_STANDARD);
Polymer.dom.flush();
assertFalse(!!page.$$('#safetyCheckSafeBrowsingButton'));
assertFalse(!!page.$$('#safetyCheckSafeBrowsingManagedIcon'));
assertIconStatusSafe(page.$$('#safeBrowsingIcon'));
});
test('safeBrowsingEnabledEnhancedUiTest', function() {
fireSafetyCheckSafeBrowsingEvent(
settings.SafetyCheckSafeBrowsingStatus.ENABLED_ENHANCED);
Polymer.dom.flush();
assertFalse(!!page.$$('#safetyCheckSafeBrowsingButton'));
assertFalse(!!page.$$('#safetyCheckSafeBrowsingManagedIcon'));
......
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