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