OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 return true; | 147 return true; |
148 | 148 |
149 // Do not fill nor save password when a user is signing in for sync. This | 149 // Do not fill nor save password when a user is signing in for sync. This |
150 // is because users need to remember their password if they are syncing as | 150 // is because users need to remember their password if they are syncing as |
151 // this is effectively their master password. | 151 // this is effectively their master password. |
152 return entry->GetURL().host() != chrome::kChromeUIChromeSigninHost; | 152 return entry->GetURL().host() != chrome::kChromeUIChromeSigninHost; |
153 } | 153 } |
154 | 154 |
155 bool ChromePasswordManagerClient::ShouldAskUserToSubmitURL(const GURL& url) { | 155 bool ChromePasswordManagerClient::ShouldAskUserToSubmitURL(const GURL& url) { |
156 return url.is_valid() && !url.is_empty() && url.has_host() && | 156 return url.is_valid() && !url.is_empty() && url.has_host() && |
| 157 password_manager_.IsSavingEnabledForCurrentPage() && |
157 password_manager::urls_collection_experiment::ShouldShowBubble( | 158 password_manager::urls_collection_experiment::ShouldShowBubble( |
158 GetPrefs()); | 159 GetPrefs()); |
159 } | 160 } |
160 | 161 |
161 bool ChromePasswordManagerClient::ShouldFilterAutofillResult( | 162 bool ChromePasswordManagerClient::ShouldFilterAutofillResult( |
162 const autofill::PasswordForm& form) { | 163 const autofill::PasswordForm& form) { |
163 if (!IsSyncAccountCredential(base::UTF16ToUTF8(form.username_value), | 164 if (!IsSyncAccountCredential(base::UTF16ToUTF8(form.username_value), |
164 form.signon_realm)) | 165 form.signon_realm)) |
165 return false; | 166 return false; |
166 | 167 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 | 574 |
574 if (group_name == "DisallowSyncCredentialsForReauth") { | 575 if (group_name == "DisallowSyncCredentialsForReauth") { |
575 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; | 576 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; |
576 } else if (group_name == "DisallowSyncCredentials") { | 577 } else if (group_name == "DisallowSyncCredentials") { |
577 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; | 578 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; |
578 } else { | 579 } else { |
579 // Allow by default. | 580 // Allow by default. |
580 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; | 581 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; |
581 } | 582 } |
582 } | 583 } |
OLD | NEW |