| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/password_manager/core/browser/password_manager.h" | 5 #include "components/password_manager/core/browser/password_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 // password saving enabled. | 326 // password saving enabled. |
| 327 PasswordStore::AuthorizationPromptPolicy prompt_policy = | 327 PasswordStore::AuthorizationPromptPolicy prompt_policy = |
| 328 *password_manager_enabled_ ? PasswordStore::ALLOW_PROMPT | 328 *password_manager_enabled_ ? PasswordStore::ALLOW_PROMPT |
| 329 : PasswordStore::DISALLOW_PROMPT; | 329 : PasswordStore::DISALLOW_PROMPT; |
| 330 | 330 |
| 331 manager->FetchMatchingLoginsFromPasswordStore(prompt_policy); | 331 manager->FetchMatchingLoginsFromPasswordStore(prompt_policy); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 bool PasswordManager::ShouldPromptUserToSavePassword() const { | 335 bool PasswordManager::ShouldPromptUserToSavePassword() const { |
| 336 return provisional_save_manager_->IsNewLogin() && | 336 return !client_->IsAutomaticPasswordSavingEnabled() && |
| 337 provisional_save_manager_->IsNewLogin() && |
| 337 !provisional_save_manager_->HasGeneratedPassword() && | 338 !provisional_save_manager_->HasGeneratedPassword() && |
| 338 !provisional_save_manager_->IsPendingCredentialsPublicSuffixMatch(); | 339 !provisional_save_manager_->IsPendingCredentialsPublicSuffixMatch(); |
| 339 } | 340 } |
| 340 | 341 |
| 341 void PasswordManager::OnPasswordFormsRendered( | 342 void PasswordManager::OnPasswordFormsRendered( |
| 342 const std::vector<PasswordForm>& visible_forms) { | 343 const std::vector<PasswordForm>& visible_forms) { |
| 343 scoped_ptr<BrowserSavePasswordProgressLogger> logger; | 344 scoped_ptr<BrowserSavePasswordProgressLogger> logger; |
| 344 if (client_->IsLoggingActive()) { | 345 if (client_->IsLoggingActive()) { |
| 345 logger.reset(new BrowserSavePasswordProgressLogger(client_)); | 346 logger.reset(new BrowserSavePasswordProgressLogger(client_)); |
| 346 logger->LogMessage(Logger::STRING_ON_PASSWORD_FORMS_RENDERED_METHOD); | 347 logger->LogMessage(Logger::STRING_ON_PASSWORD_FORMS_RENDERED_METHOD); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 observers_, | 477 observers_, |
| 477 OnAutofillDataAvailable(preferred_match.username_value, | 478 OnAutofillDataAvailable(preferred_match.username_value, |
| 478 preferred_match.password_value)); | 479 preferred_match.password_value)); |
| 479 break; | 480 break; |
| 480 } | 481 } |
| 481 | 482 |
| 482 client_->PasswordWasAutofilled(best_matches); | 483 client_->PasswordWasAutofilled(best_matches); |
| 483 } | 484 } |
| 484 | 485 |
| 485 } // namespace password_manager | 486 } // namespace password_manager |
| OLD | NEW |