| 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 "chrome/browser/password_manager/password_manager.h" | 5 #include "chrome/browser/password_manager/password_manager.h" |
| 6 | 6 |
| 7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 296 } |
| 297 | 297 |
| 298 // Looks like a successful login attempt. Either show an infobar or | 298 // Looks like a successful login attempt. Either show an infobar or |
| 299 // automatically save the login data. We prompt when the user hasn't already | 299 // automatically save the login data. We prompt when the user hasn't already |
| 300 // given consent, either through previously accepting the infobar or by having | 300 // given consent, either through previously accepting the infobar or by having |
| 301 // the browser generate the password. | 301 // the browser generate the password. |
| 302 provisional_save_manager_->SubmitPassed(); | 302 provisional_save_manager_->SubmitPassed(); |
| 303 if (provisional_save_manager_->HasGeneratedPassword()) | 303 if (provisional_save_manager_->HasGeneratedPassword()) |
| 304 UMA_HISTOGRAM_COUNTS("PasswordGeneration.Submitted", 1); | 304 UMA_HISTOGRAM_COUNTS("PasswordGeneration.Submitted", 1); |
| 305 if (provisional_save_manager_->IsNewLogin() && | 305 if (provisional_save_manager_->IsNewLogin() && |
| 306 !provisional_save_manager_->HasGeneratedPassword()) { | 306 !provisional_save_manager_->HasGeneratedPassword() && |
| 307 !provisional_save_manager_->IsPendingCredentialsPublicSuffixMatch()) { |
| 307 delegate_->AddSavePasswordInfoBarIfPermitted( | 308 delegate_->AddSavePasswordInfoBarIfPermitted( |
| 308 provisional_save_manager_.release()); | 309 provisional_save_manager_.release()); |
| 309 } else { | 310 } else { |
| 310 provisional_save_manager_->Save(); | 311 provisional_save_manager_->Save(); |
| 311 provisional_save_manager_.reset(); | 312 provisional_save_manager_.reset(); |
| 312 } | 313 } |
| 313 } | 314 } |
| 314 | 315 |
| 315 void PasswordManager::PossiblyInitializeUsernamesExperiment( | 316 void PasswordManager::PossiblyInitializeUsernamesExperiment( |
| 316 const PasswordFormMap& best_matches) const { | 317 const PasswordFormMap& best_matches) const { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 return; | 376 return; |
| 376 } | 377 } |
| 377 default: | 378 default: |
| 378 FOR_EACH_OBSERVER( | 379 FOR_EACH_OBSERVER( |
| 379 LoginModelObserver, | 380 LoginModelObserver, |
| 380 observers_, | 381 observers_, |
| 381 OnAutofillDataAvailable(preferred_match.username_value, | 382 OnAutofillDataAvailable(preferred_match.username_value, |
| 382 preferred_match.password_value)); | 383 preferred_match.password_value)); |
| 383 } | 384 } |
| 384 } | 385 } |
| OLD | NEW |