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 <stddef.h> | 7 #include <stddef.h> |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 provisional_save_manager_.swap(manager); | 353 provisional_save_manager_.swap(manager); |
354 | 354 |
355 // Cache the user-visible URL (i.e., the one seen in the omnibox). Once the | 355 // Cache the user-visible URL (i.e., the one seen in the omnibox). Once the |
356 // post-submit navigation concludes, we compare the landing URL against the | 356 // post-submit navigation concludes, we compare the landing URL against the |
357 // cached and report the difference through UMA. | 357 // cached and report the difference through UMA. |
358 main_frame_url_ = client_->GetMainFrameURL(); | 358 main_frame_url_ = client_->GetMainFrameURL(); |
359 } | 359 } |
360 | 360 |
361 void PasswordManager::UpdateFormManagers() { | 361 void PasswordManager::UpdateFormManagers() { |
362 for (PasswordFormManager* form_manager : pending_login_managers_) { | 362 for (PasswordFormManager* form_manager : pending_login_managers_) { |
363 form_manager->FetchDataFromPasswordStore( | 363 form_manager->FetchDataFromPasswordStore(); |
364 client_->GetAuthorizationPromptPolicy(form_manager->observed_form())); | |
365 } | 364 } |
366 } | 365 } |
367 | 366 |
368 void PasswordManager::RecordFailure(ProvisionalSaveFailure failure, | 367 void PasswordManager::RecordFailure(ProvisionalSaveFailure failure, |
369 const GURL& form_origin, | 368 const GURL& form_origin, |
370 BrowserSavePasswordProgressLogger* logger) { | 369 BrowserSavePasswordProgressLogger* logger) { |
371 UMA_HISTOGRAM_ENUMERATION( | 370 UMA_HISTOGRAM_ENUMERATION( |
372 "PasswordManager.ProvisionalSaveFailure", failure, MAX_FAILURE_VALUE); | 371 "PasswordManager.ProvisionalSaveFailure", failure, MAX_FAILURE_VALUE); |
373 | 372 |
374 std::string group_name = | 373 std::string group_name = |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 524 |
526 if (logger) | 525 if (logger) |
527 logger->LogFormSignatures(Logger::STRING_ADDING_SIGNATURE, *iter); | 526 logger->LogFormSignatures(Logger::STRING_ADDING_SIGNATURE, *iter); |
528 bool ssl_valid = iter->origin.SchemeIsCryptographic(); | 527 bool ssl_valid = iter->origin.SchemeIsCryptographic(); |
529 PasswordFormManager* manager = new PasswordFormManager( | 528 PasswordFormManager* manager = new PasswordFormManager( |
530 this, client_, | 529 this, client_, |
531 (driver ? driver->AsWeakPtr() : base::WeakPtr<PasswordManagerDriver>()), | 530 (driver ? driver->AsWeakPtr() : base::WeakPtr<PasswordManagerDriver>()), |
532 *iter, ssl_valid); | 531 *iter, ssl_valid); |
533 pending_login_managers_.push_back(manager); | 532 pending_login_managers_.push_back(manager); |
534 | 533 |
535 PasswordStore::AuthorizationPromptPolicy prompt_policy = | 534 manager->FetchDataFromPasswordStore(); |
536 client_->GetAuthorizationPromptPolicy(*iter); | |
537 | |
538 manager->FetchDataFromPasswordStore(prompt_policy); | |
539 } | 535 } |
540 | 536 |
541 if (logger) { | 537 if (logger) { |
542 logger->LogNumber(Logger::STRING_NEW_NUMBER_LOGIN_MANAGERS, | 538 logger->LogNumber(Logger::STRING_NEW_NUMBER_LOGIN_MANAGERS, |
543 pending_login_managers_.size()); | 539 pending_login_managers_.size()); |
544 } | 540 } |
545 } | 541 } |
546 | 542 |
547 bool PasswordManager::CanProvisionalManagerSave() { | 543 bool PasswordManager::CanProvisionalManagerSave() { |
548 scoped_ptr<BrowserSavePasswordProgressLogger> logger; | 544 scoped_ptr<BrowserSavePasswordProgressLogger> logger; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 matched_manager_it = iter; | 853 matched_manager_it = iter; |
858 current_match_result = result; | 854 current_match_result = result; |
859 } | 855 } |
860 } | 856 } |
861 if (matched_manager_it != pending_login_managers_.end()) | 857 if (matched_manager_it != pending_login_managers_.end()) |
862 return *matched_manager_it; | 858 return *matched_manager_it; |
863 return nullptr; | 859 return nullptr; |
864 } | 860 } |
865 | 861 |
866 } // namespace password_manager | 862 } // namespace password_manager |
OLD | NEW |