Commit ec0d1338 authored by Vadym Doroshenko's avatar Vadym Doroshenko Committed by Commit Bot

Revert "[Passwords] No result view fix in password check"

This reverts commit 39bb3cd1.

Reason for revert: It looks it breaks test CrSettingsPasswordsCheckTest.All on Windows
https://ci.chromium.org/p/chromium/builders/ci/Win7%20Tests%20%28dbg%29%281%29

Original change's description:
> [Passwords] No result view fix in password check
> 
> This CL changes the way visibility of 'No result view' is calculated.
> The label will be shown only if:
> - user had successful check with 0 compromised passwords found
> - user is signed in
> - breach detection is turned on in settings
> 
> Bug: 1061496
> Change-Id: I9f1e4b5f7aef51749b970964c2b701ee2193ba53
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108501
> Commit-Queue: Viktor Semeniuk <vsemeniuk@google.com>
> Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#751674}

TBR=jdoerrie@chromium.org,vsemeniuk@google.com

Change-Id: I20479f59c5a3e97c2f8d70a3a96179faff861624
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1061496
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2111294Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751971}
parent 241e6758
...@@ -99,7 +99,6 @@ js_library("password_check") { ...@@ -99,7 +99,6 @@ js_library("password_check") {
deps = [ deps = [
":password_manager_proxy", ":password_manager_proxy",
"..:plural_string_proxy", "..:plural_string_proxy",
"../prefs:prefs_behavior",
"//ui/webui/resources/js:i18n_behavior", "//ui/webui/resources/js:i18n_behavior",
] ]
} }
...@@ -292,7 +291,6 @@ js_library("password_check.m") { ...@@ -292,7 +291,6 @@ js_library("password_check.m") {
deps = [ deps = [
":password_manager_proxy.m", ":password_manager_proxy.m",
"..:plural_string_proxy.m", "..:plural_string_proxy.m",
"../prefs:prefs_behavior.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:i18n_behavior.m", "//ui/webui/resources/js:i18n_behavior.m",
] ]
...@@ -525,12 +523,12 @@ polymer_modulizer("password_check") { ...@@ -525,12 +523,12 @@ polymer_modulizer("password_check") {
js_file = "password_check.js" js_file = "password_check.js"
html_file = "password_check.html" html_file = "password_check.html"
html_type = "dom-module" html_type = "dom-module"
auto_imports = settings_auto_imports + [ auto_imports = [
"chrome/browser/resources/settings/autofill_page/password_manager_proxy.html|PasswordManagerImpl,PasswordManagerProxy", "chrome/browser/resources/settings/autofill_page/password_manager_proxy.html|PasswordManagerImpl,PasswordManagerProxy",
"chrome/browser/resources/settings/people_page/sync_browser_proxy.html|SyncBrowserProxyImpl,SyncPrefs,SyncStatus", "chrome/browser/resources/settings/people_page/sync_browser_proxy.html|SyncBrowserProxyImpl,SyncPrefs,SyncStatus",
"chrome/browser/resources/settings/plural_string_proxy.html|PluralStringProxyImpl", "chrome/browser/resources/settings/plural_string_proxy.html|PluralStringProxyImpl",
"ui/webui/resources/html/assert.html|assert", "ui/webui/resources/html/assert.html|assert",
] ]
namespace_rewrites = settings_namespace_rewrites namespace_rewrites = settings_namespace_rewrites
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
associated-control="[[$$('#passwordManagerButton')]]" associated-control="[[$$('#passwordManagerButton')]]"
page-title="$i18n{checkPasswords}" page-title="$i18n{checkPasswords}"
learn-more-url="$i18n{passwordCheckLearnMoreURL}"> learn-more-url="$i18n{passwordCheckLearnMoreURL}">
<settings-password-check prefs="{{prefs}}"></settings-password-check> <settings-password-check></settings-password-check>
</settings-subpage> </settings-subpage>
</template> </template>
<template is="dom-if" route-path="/payments"> <template is="dom-if" route-path="/payments">
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html"> <link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="password_check_edit_dialog.html"> <link rel="import" href="password_check_edit_dialog.html">
<link rel="import" href="password_check_list_item.html"> <link rel="import" href="password_check_list_item.html">
<link rel="import" href="password_manager_proxy.html"> <link rel="import" href="password_manager_proxy.html">
...@@ -108,7 +106,7 @@ ...@@ -108,7 +106,7 @@
</cr-button> </cr-button>
</div> </div>
<div id="noCompromisedCredentials" <div id="noCompromisedCredentials"
hidden$="[[!showNoCompromisedPasswordsLabel_]]"> hidden$="[[hasLeakedCredentials_(leakedPasswords)]]">
<div class="settings-box secondary"> <div class="settings-box secondary">
$i18n{noCompromisedCredentials} $i18n{noCompromisedCredentials}
</div> </div>
......
...@@ -11,7 +11,6 @@ Polymer({ ...@@ -11,7 +11,6 @@ Polymer({
behaviors: [ behaviors: [
I18nBehavior, I18nBehavior,
PrefsBehavior,
WebUIListenerBehavior, WebUIListenerBehavior,
], ],
...@@ -80,13 +79,6 @@ Polymer({ ...@@ -80,13 +79,6 @@ Polymer({
* @private {?PasswordManagerProxy.CompromisedCredential} * @private {?PasswordManagerProxy.CompromisedCredential}
*/ */
activePassword_: Object, activePassword_: Object,
/** @private */
showNoCompromisedPasswordsLabel_: {
type: Boolean,
computed:
'computeShowNoCompromisedPasswordsLabel(syncStatus_, prefs.*, status_, leakedPasswords)',
}
}, },
/** /**
...@@ -532,26 +524,5 @@ Polymer({ ...@@ -532,26 +524,5 @@ Polymer({
this.leakedPasswords = resultList.concat(addedResults); this.leakedPasswords = resultList.concat(addedResults);
}, },
/**
* @return {boolean}
* @private
*/
computeShowNoCompromisedPasswordsLabel() {
// Check if user isn't signed in.
if (!this.syncStatus_ || !this.syncStatus_.signedIn) {
return false;
}
// Check if breach detection is turned off in settings.
if (!this.prefs ||
!this.getPref('profile.password_manager_leak_detection').value) {
return false;
}
// Return true if there was a successful check and no compromised passwords
// were found.
return !this.hasLeakedCredentials_(this.leakedPasswords) &&
this.showsTimestamp_(this.status_);
},
}); });
})(); })();
...@@ -310,33 +310,13 @@ cr.define('settings_passwords_check', function() { ...@@ -310,33 +310,13 @@ cr.define('settings_passwords_check', function() {
}); });
// Test verifies that if no compromised credentials found than list is not // Test verifies that if no compromised credentials found than list is not
// shown // shown TODO(https://crbug.com/1047726): add additional checks after
// UI is implemented
test('testNoCompromisedCredentials', function() { test('testNoCompromisedCredentials', function() {
const data = passwordManager.data; const checkPasswordSection = createCheckPasswordSection();
data.checkStatus = autofill_test_util.makePasswordCheckStatus( assertTrue(checkPasswordSection.$.passwordCheckBody.hidden);
/*state=*/ PasswordCheckState.IDLE, assertFalse(checkPasswordSection.$.noCompromisedCredentials.hidden);
/*checked=*/ 4, validateLeakedPasswordsList(checkPasswordSection, []);
/*remaining=*/ 0,
/*lastCheck=*/ 'Just now');
data.leakedCredentials = [];
const section = createCheckPasswordSection();
assertFalse(isElementVisible(section.$.noCompromisedCredentials));
cr.webUIListenerCallback(
'sync-prefs-changed', sync_test_util.getSyncAllPrefs());
sync_test_util.simulateSyncStatus({signedIn: true});
// Initialize with dummy data breach detection settings
section.prefs = {
profile: {password_manager_leak_detection: {value: true}}
};
return passwordManager.whenCalled('getCompromisedCredentials')
.then(() => {
Polymer.dom.flush();
assertFalse(isElementVisible(section.$.passwordCheckBody));
assertTrue(isElementVisible(section.$.noCompromisedCredentials));
});
}); });
// Test verifies that compromised credentials are displayed in a proper way // Test verifies that compromised credentials are displayed in a proper way
......
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