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_dispatc
her.h" | 5 #include "components/password_manager/content/browser/credential_manager_dispatc
her.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // determine whether or not the credential exists, and calling UpdateLogin | 70 // determine whether or not the credential exists, and calling UpdateLogin |
71 // accordingly. | 71 // accordingly. |
72 form_manager_.reset(new CredentialManagerPasswordFormManager( | 72 form_manager_.reset(new CredentialManagerPasswordFormManager( |
73 client_, GetDriver(), *form, this)); | 73 client_, GetDriver(), *form, this)); |
74 } | 74 } |
75 | 75 |
76 void CredentialManagerDispatcher::OnProvisionalSaveComplete() { | 76 void CredentialManagerDispatcher::OnProvisionalSaveComplete() { |
77 DCHECK(form_manager_); | 77 DCHECK(form_manager_); |
78 if (client_->IsSavingEnabledForCurrentPage() && | 78 if (client_->IsSavingEnabledForCurrentPage() && |
79 !form_manager_->IsBlacklisted()) { | 79 !form_manager_->IsBlacklisted()) { |
80 client_->PromptUserToSavePassword( | 80 client_->PromptUserToSaveOrUpdatePassword( |
81 form_manager_.Pass(), CredentialSourceType::CREDENTIAL_SOURCE_API); | 81 form_manager_.Pass(), CredentialSourceType::CREDENTIAL_SOURCE_API, |
| 82 false); |
82 } | 83 } |
83 } | 84 } |
84 | 85 |
85 void CredentialManagerDispatcher::OnRequireUserMediation(int request_id) { | 86 void CredentialManagerDispatcher::OnRequireUserMediation(int request_id) { |
86 DCHECK(request_id); | 87 DCHECK(request_id); |
87 | 88 |
88 PasswordStore* store = GetPasswordStore(); | 89 PasswordStore* store = GetPasswordStore(); |
89 if (store) { | 90 if (store) { |
90 if (!pending_require_user_mediation_) { | 91 if (!pending_require_user_mediation_) { |
91 pending_require_user_mediation_.reset( | 92 pending_require_user_mediation_.reset( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 PasswordManagerClient* CredentialManagerDispatcher::client() const { | 188 PasswordManagerClient* CredentialManagerDispatcher::client() const { |
188 return client_; | 189 return client_; |
189 } | 190 } |
190 | 191 |
191 void CredentialManagerDispatcher::DoneRequiringUserMediation() { | 192 void CredentialManagerDispatcher::DoneRequiringUserMediation() { |
192 DCHECK(pending_require_user_mediation_); | 193 DCHECK(pending_require_user_mediation_); |
193 pending_require_user_mediation_.reset(); | 194 pending_require_user_mediation_.reset(); |
194 } | 195 } |
195 | 196 |
196 } // namespace password_manager | 197 } // namespace password_manager |
OLD | NEW |