| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/password_manager/test_password_store.h" | 5 #include "chrome/browser/password_manager/test_password_store.h" |
| 6 | 6 |
| 7 #include "components/autofill/core/common/password_form.h" | 7 #include "components/autofill/core/common/password_form.h" |
| 8 | 8 |
| 9 // static | 9 // static |
| 10 scoped_refptr<RefcountedBrowserContextKeyedService> TestPasswordStore::Create( | 10 scoped_refptr<RefcountedBrowserContextKeyedService> TestPasswordStore::Create( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 it != forms.end(); ++it) { | 63 it != forms.end(); ++it) { |
| 64 if (FormsAreEquivalent(form, *it)) { | 64 if (FormsAreEquivalent(form, *it)) { |
| 65 forms.erase(it); | 65 forms.erase(it); |
| 66 return; | 66 return; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| 71 void TestPasswordStore::GetLoginsImpl( | 71 void TestPasswordStore::GetLoginsImpl( |
| 72 const autofill::PasswordForm& form, | 72 const autofill::PasswordForm& form, |
| 73 PasswordStore::AuthorizationPromptPolicy prompt_policy, |
| 73 const PasswordStore::ConsumerCallbackRunner& runner) { | 74 const PasswordStore::ConsumerCallbackRunner& runner) { |
| 74 std::vector<autofill::PasswordForm*> matched_forms; | 75 std::vector<autofill::PasswordForm*> matched_forms; |
| 75 std::vector<autofill::PasswordForm> forms = | 76 std::vector<autofill::PasswordForm> forms = |
| 76 stored_passwords_[form.signon_realm]; | 77 stored_passwords_[form.signon_realm]; |
| 77 for (std::vector<autofill::PasswordForm>::iterator it = forms.begin(); | 78 for (std::vector<autofill::PasswordForm>::iterator it = forms.begin(); |
| 78 it != forms.end(); ++it) { | 79 it != forms.end(); ++it) { |
| 79 matched_forms.push_back(new autofill::PasswordForm(*it)); | 80 matched_forms.push_back(new autofill::PasswordForm(*it)); |
| 80 } | 81 } |
| 81 runner.Run(matched_forms); | 82 runner.Run(matched_forms); |
| 82 } | 83 } |
| 83 | 84 |
| 84 bool TestPasswordStore::FillAutofillableLogins( | 85 bool TestPasswordStore::FillAutofillableLogins( |
| 85 std::vector<autofill::PasswordForm*>* forms) { | 86 std::vector<autofill::PasswordForm*>* forms) { |
| 86 return true; | 87 return true; |
| 87 } | 88 } |
| 88 | 89 |
| 89 bool TestPasswordStore::FillBlacklistLogins( | 90 bool TestPasswordStore::FillBlacklistLogins( |
| 90 std::vector<autofill::PasswordForm*>* forms) { | 91 std::vector<autofill::PasswordForm*>* forms) { |
| 91 return true; | 92 return true; |
| 92 } | 93 } |
| OLD | NEW |