Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: components/password_manager/content/browser/credential_manager_impl.cc

Issue 2252283005: Introduce password_manager::FormFetcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621355_const_best_matches
Patch Set: Keep updating PasswordStore for blacklisting Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/password_manager.gypi ('k') | components/password_manager/core/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/password_manager/content/browser/credential_manager_impl.h" 5 #include "components/password_manager/content/browser/credential_manager_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/user_metrics.h" 10 #include "base/metrics/user_metrics.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 void CredentialManagerImpl::OnProvisionalSaveComplete() { 72 void CredentialManagerImpl::OnProvisionalSaveComplete() {
73 DCHECK(form_manager_); 73 DCHECK(form_manager_);
74 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); 74 DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage());
75 const autofill::PasswordForm& form = form_manager_->pending_credentials(); 75 const autofill::PasswordForm& form = form_manager_->pending_credentials();
76 76
77 if (!form.federation_origin.unique()) { 77 if (!form.federation_origin.unique()) {
78 // If this is a federated credential, check it against the federated matches 78 // If this is a federated credential, check it against the federated matches
79 // produced by the PasswordFormManager. If a match is found, update it and 79 // produced by the PasswordFormManager. If a match is found, update it and
80 // return. 80 // return.
81 for (const auto& match : form_manager_->federated_matches()) { 81 for (const auto& match :
82 form_manager_->form_fetcher()->GetFederatedMatches()) {
82 if (match->username_value == form.username_value && 83 if (match->username_value == form.username_value &&
83 match->federation_origin.IsSameOriginWith(form.federation_origin)) { 84 match->federation_origin.IsSameOriginWith(form.federation_origin)) {
84 form_manager_->Update(*match); 85 form_manager_->Update(*match);
85 return; 86 return;
86 } 87 }
87 } 88 }
88 } else if (!form_manager_->IsNewLogin()) { 89 } else if (!form_manager_->IsNewLogin()) {
89 // Otherwise, if this is not a new password credential, update the existing 90 // Otherwise, if this is not a new password credential, update the existing
90 // credential without prompting the user. This will also update the 91 // credential without prompting the user. This will also update the
91 // 'skip_zero_click' state, as we've gotten an explicit signal that the page 92 // 'skip_zero_click' state, as we've gotten an explicit signal that the page
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 DCHECK(pending_require_user_mediation_); 273 DCHECK(pending_require_user_mediation_);
273 pending_require_user_mediation_.reset(); 274 pending_require_user_mediation_.reset();
274 } 275 }
275 276
276 bool CredentialManagerImpl::IsUpdatingCredentialAllowed() const { 277 bool CredentialManagerImpl::IsUpdatingCredentialAllowed() const {
277 return !client_->DidLastPageLoadEncounterSSLErrors() && 278 return !client_->DidLastPageLoadEncounterSSLErrors() &&
278 !client_->IsOffTheRecord(); 279 !client_->IsOffTheRecord();
279 } 280 }
280 281
281 } // namespace password_manager 282 } // namespace password_manager
OLDNEW
« no previous file with comments | « components/password_manager.gypi ('k') | components/password_manager/core/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698