OLD | NEW |
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // understands the credential management API and so can be trusted to notify | 119 // understands the credential management API and so can be trusted to notify |
120 // us when they sign the user out. | 120 // us when they sign the user out. |
121 form_manager_->Update(*form_manager_->preferred_match()); | 121 form_manager_->Update(*form_manager_->preferred_match()); |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
125 // Otherwise, this is a new form, so as the user if they'd like to save. | 125 // Otherwise, this is a new form, so as the user if they'd like to save. |
126 client_->PromptUserToSaveOrUpdatePassword(std::move(form_manager_), false); | 126 client_->PromptUserToSaveOrUpdatePassword(std::move(form_manager_), false); |
127 } | 127 } |
128 | 128 |
129 void CredentialManagerImpl::RequireUserMediation( | 129 void CredentialManagerImpl::PreventSilentAccess( |
130 RequireUserMediationCallback callback) { | 130 PreventSilentAccessCallback callback) { |
131 if (password_manager_util::IsLoggingActive(client_)) { | 131 if (password_manager_util::IsLoggingActive(client_)) { |
132 CredentialManagerLogger(client_->GetLogManager()) | 132 CredentialManagerLogger(client_->GetLogManager()) |
133 .LogRequireUserMediation(web_contents()->GetLastCommittedURL()); | 133 .LogPreventSilentAccess(web_contents()->GetLastCommittedURL()); |
134 } | 134 } |
135 // Send acknowledge response back. | 135 // Send acknowledge response back. |
136 std::move(callback).Run(); | 136 std::move(callback).Run(); |
137 | 137 |
138 PasswordStore* store = GetPasswordStore(); | 138 PasswordStore* store = GetPasswordStore(); |
139 if (!store || !client_->IsSavingAndFillingEnabledForCurrentPage() || | 139 if (!store || !client_->IsSavingAndFillingEnabledForCurrentPage() || |
140 !client_->OnCredentialManagerUsed()) | 140 !client_->OnCredentialManagerUsed()) |
141 return; | 141 return; |
142 | 142 |
143 if (!pending_require_user_mediation_) { | 143 if (!pending_require_user_mediation_) { |
144 pending_require_user_mediation_.reset( | 144 pending_require_user_mediation_.reset( |
145 new CredentialManagerPendingRequireUserMediationTask(this)); | 145 new CredentialManagerPendingPreventSilentAccessTask(this)); |
146 } | 146 } |
147 pending_require_user_mediation_->AddOrigin(GetSynthesizedFormForOrigin()); | 147 pending_require_user_mediation_->AddOrigin(GetSynthesizedFormForOrigin()); |
148 } | 148 } |
149 | 149 |
150 void CredentialManagerImpl::Get(CredentialMediationRequirement mediation, | 150 void CredentialManagerImpl::Get(CredentialMediationRequirement mediation, |
151 bool include_passwords, | 151 bool include_passwords, |
152 const std::vector<GURL>& federations, | 152 const std::vector<GURL>& federations, |
153 GetCallback callback) { | 153 GetCallback callback) { |
154 using metrics_util::LogCredentialManagerGetResult; | 154 using metrics_util::LogCredentialManagerGetResult; |
155 | 155 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin() | 279 PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin() |
280 const { | 280 const { |
281 PasswordStore::FormDigest digest = { | 281 PasswordStore::FormDigest digest = { |
282 autofill::PasswordForm::SCHEME_HTML, std::string(), | 282 autofill::PasswordForm::SCHEME_HTML, std::string(), |
283 web_contents()->GetLastCommittedURL().GetOrigin()}; | 283 web_contents()->GetLastCommittedURL().GetOrigin()}; |
284 digest.signon_realm = digest.origin.spec(); | 284 digest.signon_realm = digest.origin.spec(); |
285 return digest; | 285 return digest; |
286 } | 286 } |
287 | 287 |
288 } // namespace password_manager | 288 } // namespace password_manager |
OLD | NEW |