Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 1031153002: [Credential Management] Smart lock save Credentials bubble should not always pop up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/chrome_password_manager_client.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
index 4605e3a5cc6483b430c42c95f538b82878e23fce..8d1c17ec68c84d2823ec68fdf346f13888933a8e 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -114,22 +114,26 @@ bool ChromePasswordManagerClient::IsPasswordManagerEnabledForCurrentPage()
DCHECK(web_contents());
content::NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
+ bool is_enabled;
vabr (Chromium) 2015/03/30 10:58:42 Please initialise to false (which seems to be a sa
melandory 2015/04/07 13:14:13 Done.
if (!entry) {
// TODO(gcasto): Determine if fix for crbug.com/388246 is relevant here.
- return true;
+ is_enabled = true;
+ } else if (IsURLPasswordWebsiteReauth(entry->GetURL())) {
+ // Disable the password manager for online password management.
+ is_enabled = false;
+ } else if (EnabledForSyncSignin()) {
+ is_enabled = true;
+ } else {
+ // Do not fill nor save password when a user is signing in for sync. This
+ // is because users need to remember their password if they are syncing as
+ // this is effectively their master password.
+ is_enabled = entry->GetURL().host() != chrome::kChromeUIChromeSigninHost;
}
-
- // Disable the password manager for online password management.
- if (IsURLPasswordWebsiteReauth(entry->GetURL()))
- return false;
-
- if (EnabledForSyncSignin())
- return true;
-
- // Do not fill nor save password when a user is signing in for sync. This
- // is because users need to remember their password if they are syncing as
- // this is effectively their master password.
- return entry->GetURL().host() != chrome::kChromeUIChromeSigninHost;
+ if (IsLoggingActive()) {
+ password_manager::BrowserSavePasswordProgressLogger logger(this);
+ logger.LogBoolean(Logger::STRING_CLIENT_CHECK_PRESENT, is_enabled);
vabr (Chromium) 2015/03/30 10:58:42 nit: The Logger's enum name seems a bit outdated.
melandory 2015/04/07 13:14:12 Done.
+ }
+ return is_enabled;
}
bool ChromePasswordManagerClient::ShouldFilterAutofillResult(
@@ -347,10 +351,17 @@ bool ChromePasswordManagerClient::WasLastNavigationHTTPError() const {
bool ChromePasswordManagerClient::DidLastPageLoadEncounterSSLErrors() const {
content::NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
- if (!entry)
- return false;
-
- return net::IsCertStatusError(entry->GetSSL().cert_status);
+ bool ssl_errors;
vabr (Chromium) 2015/03/30 10:58:42 Please initialise to true (which seems to be a saf
melandory 2015/04/07 13:14:12 Done.
+ if (!entry) {
+ ssl_errors = false;
+ } else {
+ ssl_errors = net::IsCertStatusError(entry->GetSSL().cert_status);
+ }
+ if (IsLoggingActive()) {
+ password_manager::BrowserSavePasswordProgressLogger logger(this);
+ logger.LogBoolean(Logger::STRING_SSL_ERRORS_PRESENT, ssl_errors);
+ }
+ return ssl_errors;
}
bool ChromePasswordManagerClient::IsOffTheRecord() const {

Powered by Google App Engine
This is Rietveld 408576698