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/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 } | 294 } |
295 | 295 |
296 // Looks like a successful login attempt. Either show an infobar or | 296 // Looks like a successful login attempt. Either show an infobar or |
297 // automatically save the login data. We prompt when the user hasn't already | 297 // automatically save the login data. We prompt when the user hasn't already |
298 // given consent, either through previously accepting the infobar or by having | 298 // given consent, either through previously accepting the infobar or by having |
299 // the browser generate the password. | 299 // the browser generate the password. |
300 provisional_save_manager_->SubmitPassed(); | 300 provisional_save_manager_->SubmitPassed(); |
301 if (provisional_save_manager_->HasGeneratedPassword()) | 301 if (provisional_save_manager_->HasGeneratedPassword()) |
302 UMA_HISTOGRAM_COUNTS("PasswordGeneration.Submitted", 1); | 302 UMA_HISTOGRAM_COUNTS("PasswordGeneration.Submitted", 1); |
303 if (provisional_save_manager_->IsNewLogin() && | 303 if (provisional_save_manager_->IsNewLogin() && |
304 !provisional_save_manager_->HasGeneratedPassword()) { | 304 !provisional_save_manager_->HasGeneratedPassword() && |
| 305 !provisional_save_manager_->IsPSLOriginMatched()) { |
305 delegate_->AddSavePasswordInfoBarIfPermitted( | 306 delegate_->AddSavePasswordInfoBarIfPermitted( |
306 provisional_save_manager_.release()); | 307 provisional_save_manager_.release()); |
307 } else { | 308 } else { |
308 provisional_save_manager_->Save(); | 309 provisional_save_manager_->Save(); |
309 provisional_save_manager_.reset(); | 310 provisional_save_manager_.reset(); |
310 } | 311 } |
311 } | 312 } |
312 | 313 |
313 void PasswordManager::PossiblyInitializeUsernamesExperiment( | 314 void PasswordManager::PossiblyInitializeUsernamesExperiment( |
314 const PasswordFormMap& best_matches) const { | 315 const PasswordFormMap& best_matches) const { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 delegate_->FillPasswordForm(fill_data); | 373 delegate_->FillPasswordForm(fill_data); |
373 return; | 374 return; |
374 } | 375 } |
375 default: | 376 default: |
376 if (observer_) { | 377 if (observer_) { |
377 observer_->OnAutofillDataAvailable(preferred_match.username_value, | 378 observer_->OnAutofillDataAvailable(preferred_match.username_value, |
378 preferred_match.password_value); | 379 preferred_match.password_value); |
379 } | 380 } |
380 } | 381 } |
381 } | 382 } |
OLD | NEW |