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

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

Issue 2716583003: Rename Origin.unique() to opaque().
Patch Set: Mac fixes Created 3 years, 9 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
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/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 const autofill::PasswordForm& form = form_manager_->pending_credentials(); 93 const autofill::PasswordForm& form = form_manager_->pending_credentials();
94 94
95 if (form_manager_->IsPendingCredentialsPublicSuffixMatch()) { 95 if (form_manager_->IsPendingCredentialsPublicSuffixMatch()) {
96 // Having a credential with a PSL match implies there is no credential with 96 // Having a credential with a PSL match implies there is no credential with
97 // an exactly matching origin and username. In order to avoid showing a save 97 // an exactly matching origin and username. In order to avoid showing a save
98 // bubble to the user Save() is called directly. 98 // bubble to the user Save() is called directly.
99 form_manager_->Save(); 99 form_manager_->Save();
100 return; 100 return;
101 } 101 }
102 102
103 if (!form.federation_origin.unique()) { 103 if (!form.federation_origin.opaque()) {
104 // If this is a federated credential, check it against the federated matches 104 // If this is a federated credential, check it against the federated matches
105 // produced by the PasswordFormManager. If a match is found, update it and 105 // produced by the PasswordFormManager. If a match is found, update it and
106 // return. 106 // return.
107 for (auto* match : form_manager_->form_fetcher()->GetFederatedMatches()) { 107 for (auto* match : form_manager_->form_fetcher()->GetFederatedMatches()) {
108 if (match->username_value == form.username_value && 108 if (match->username_value == form.username_value &&
109 match->federation_origin.IsSameOriginWith(form.federation_origin)) { 109 match->federation_origin.IsSameOriginWith(form.federation_origin)) {
110 form_manager_->Update(*match); 110 form_manager_->Update(*match);
111 return; 111 return;
112 } 112 }
113 } 113 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 send_callback.Run(info); 231 send_callback.Run(info);
232 pending_request_.reset(); 232 pending_request_.reset();
233 } 233 }
234 234
235 void CredentialManagerImpl::SendPasswordForm( 235 void CredentialManagerImpl::SendPasswordForm(
236 const SendCredentialCallback& send_callback, 236 const SendCredentialCallback& send_callback,
237 const autofill::PasswordForm* form) { 237 const autofill::PasswordForm* form) {
238 CredentialInfo info; 238 CredentialInfo info;
239 if (form) { 239 if (form) {
240 password_manager::CredentialType type_to_return = 240 password_manager::CredentialType type_to_return =
241 form->federation_origin.unique() 241 form->federation_origin.opaque()
242 ? CredentialType::CREDENTIAL_TYPE_PASSWORD 242 ? CredentialType::CREDENTIAL_TYPE_PASSWORD
243 : CredentialType::CREDENTIAL_TYPE_FEDERATED; 243 : CredentialType::CREDENTIAL_TYPE_FEDERATED;
244 info = CredentialInfo(*form, type_to_return); 244 info = CredentialInfo(*form, type_to_return);
245 if (PasswordStore* store = GetPasswordStore()) { 245 if (PasswordStore* store = GetPasswordStore()) {
246 if (form->skip_zero_click && IsZeroClickAllowed()) { 246 if (form->skip_zero_click && IsZeroClickAllowed()) {
247 autofill::PasswordForm update_form = *form; 247 autofill::PasswordForm update_form = *form;
248 update_form.skip_zero_click = false; 248 update_form.skip_zero_click = false;
249 store->UpdateLogin(update_form); 249 store->UpdateLogin(update_form);
250 } 250 }
251 } 251 }
(...skipping 28 matching lines...) Expand all
280 PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin() 280 PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin()
281 const { 281 const {
282 PasswordStore::FormDigest digest = { 282 PasswordStore::FormDigest digest = {
283 autofill::PasswordForm::SCHEME_HTML, std::string(), 283 autofill::PasswordForm::SCHEME_HTML, std::string(),
284 web_contents()->GetLastCommittedURL().GetOrigin()}; 284 web_contents()->GetLastCommittedURL().GetOrigin()};
285 digest.signon_realm = digest.origin.spec(); 285 digest.signon_realm = digest.origin.spec();
286 return digest; 286 return digest;
287 } 287 }
288 288
289 } // namespace password_manager 289 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698