OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_passwor
d_form_manager.h" | 5 #include "components/password_manager/content/browser/credential_manager_passwor
d_form_manager.h" |
6 | 6 |
7 #include "components/autofill/core/common/password_form.h" | 7 #include "components/autofill/core/common/password_form.h" |
8 #include "components/password_manager/content/browser/content_credential_manager
_dispatcher.h" | 8 #include "components/password_manager/content/browser/content_credential_manager
_dispatcher.h" |
9 #include "components/password_manager/core/browser/password_manager_client.h" | 9 #include "components/password_manager/core/browser/password_manager_client.h" |
10 #include "components/password_manager/core/browser/password_store.h" | 10 #include "components/password_manager/core/browser/password_store.h" |
11 | 11 |
12 using autofill::PasswordForm; | 12 using autofill::PasswordForm; |
13 | 13 |
14 namespace password_manager { | 14 namespace password_manager { |
15 | 15 |
16 CredentialManagerPasswordFormManager::CredentialManagerPasswordFormManager( | 16 CredentialManagerPasswordFormManager::CredentialManagerPasswordFormManager( |
17 PasswordManagerClient* client, | 17 PasswordManagerClient* client, |
| 18 PasswordManagerDriver* driver, |
18 const PasswordForm& observed_form, | 19 const PasswordForm& observed_form, |
19 ContentCredentialManagerDispatcher* dispatcher) | 20 ContentCredentialManagerDispatcher* dispatcher) |
20 : PasswordFormManager(client->GetDriver()->GetPasswordManager(), | 21 : PasswordFormManager(driver->GetPasswordManager(), |
21 client, | 22 client, |
22 client->GetDriver(), | 23 driver, |
23 observed_form, | 24 observed_form, |
24 true), | 25 true), |
25 dispatcher_(dispatcher) { | 26 dispatcher_(dispatcher) { |
26 FetchMatchingLoginsFromPasswordStore(PasswordStore::DISALLOW_PROMPT); | 27 FetchMatchingLoginsFromPasswordStore(PasswordStore::DISALLOW_PROMPT); |
27 } | 28 } |
28 | 29 |
29 CredentialManagerPasswordFormManager::~CredentialManagerPasswordFormManager() { | 30 CredentialManagerPasswordFormManager::~CredentialManagerPasswordFormManager() { |
30 } | 31 } |
31 | 32 |
32 void CredentialManagerPasswordFormManager::OnGetPasswordStoreResults( | 33 void CredentialManagerPasswordFormManager::OnGetPasswordStoreResults( |
33 const std::vector<PasswordForm*>& results) { | 34 const std::vector<PasswordForm*>& results) { |
34 PasswordFormManager::OnGetPasswordStoreResults(results); | 35 PasswordFormManager::OnGetPasswordStoreResults(results); |
35 | 36 |
36 // Mark the form as "preferred", as we've been told by the API that this is | 37 // Mark the form as "preferred", as we've been told by the API that this is |
37 // indeed the credential set that the user used to sign into the site. | 38 // indeed the credential set that the user used to sign into the site. |
38 PasswordForm provisionally_saved_form(observed_form()); | 39 PasswordForm provisionally_saved_form(observed_form()); |
39 provisionally_saved_form.preferred = true; | 40 provisionally_saved_form.preferred = true; |
40 ProvisionallySave(provisionally_saved_form, IGNORE_OTHER_POSSIBLE_USERNAMES); | 41 ProvisionallySave(provisionally_saved_form, IGNORE_OTHER_POSSIBLE_USERNAMES); |
41 dispatcher_->OnProvisionalSaveComplete(); | 42 dispatcher_->OnProvisionalSaveComplete(); |
42 } | 43 } |
43 | 44 |
44 } // namespace password_manager | 45 } // namespace password_manager |
OLD | NEW |