OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/password_store_x.h" | 5 #include "chrome/browser/password_manager/password_store_x.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return false; | 77 return false; |
78 } | 78 } |
79 | 79 |
80 bool RemoveLoginsSyncedBetween( | 80 bool RemoveLoginsSyncedBetween( |
81 base::Time delete_begin, | 81 base::Time delete_begin, |
82 base::Time delete_end, | 82 base::Time delete_end, |
83 password_manager::PasswordStoreChangeList* changes) override { | 83 password_manager::PasswordStoreChangeList* changes) override { |
84 return false; | 84 return false; |
85 } | 85 } |
86 | 86 |
87 bool DisableAutoSignInForAllLogins( | 87 bool DisableAutoSignInForOrigins( |
| 88 const base::Callback<bool(const GURL&)>& origin_filter, |
88 password_manager::PasswordStoreChangeList* changes) override { | 89 password_manager::PasswordStoreChangeList* changes) override { |
89 return false; | 90 return false; |
90 } | 91 } |
91 | 92 |
92 // Use this as a landmine to check whether results of failed Get*Logins calls | 93 // Use this as a landmine to check whether results of failed Get*Logins calls |
93 // get ignored. | 94 // get ignored. |
94 static ScopedVector<autofill::PasswordForm> CreateTrashForms() { | 95 static ScopedVector<autofill::PasswordForm> CreateTrashForms() { |
95 ScopedVector<autofill::PasswordForm> forms; | 96 ScopedVector<autofill::PasswordForm> forms; |
96 PasswordForm trash; | 97 PasswordForm trash; |
97 trash.username_element = base::ASCIIToUTF16("trash u. element"); | 98 trash.username_element = base::ASCIIToUTF16("trash u. element"); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 if (delete_begin <= all_forms_[i].date_synced && | 185 if (delete_begin <= all_forms_[i].date_synced && |
185 (delete_end.is_null() || all_forms_[i].date_synced < delete_end)) { | 186 (delete_end.is_null() || all_forms_[i].date_synced < delete_end)) { |
186 changes->push_back(password_manager::PasswordStoreChange( | 187 changes->push_back(password_manager::PasswordStoreChange( |
187 password_manager::PasswordStoreChange::REMOVE, all_forms_[i])); | 188 password_manager::PasswordStoreChange::REMOVE, all_forms_[i])); |
188 erase(i--); | 189 erase(i--); |
189 } | 190 } |
190 } | 191 } |
191 return true; | 192 return true; |
192 } | 193 } |
193 | 194 |
194 bool DisableAutoSignInForAllLogins( | 195 bool DisableAutoSignInForOrigins( |
| 196 const base::Callback<bool(const GURL&)>& origin_filter, |
195 password_manager::PasswordStoreChangeList* changes) override { | 197 password_manager::PasswordStoreChangeList* changes) override { |
196 return true; | 198 return true; |
197 } | 199 } |
198 | 200 |
199 bool GetLogins(const PasswordForm& form, | 201 bool GetLogins(const PasswordForm& form, |
200 ScopedVector<autofill::PasswordForm>* forms) override { | 202 ScopedVector<autofill::PasswordForm>* forms) override { |
201 for (size_t i = 0; i < all_forms_.size(); ++i) | 203 for (size_t i = 0; i < all_forms_.size(); ++i) |
202 if (all_forms_[i].signon_realm == form.signon_realm) | 204 if (all_forms_[i].signon_realm == form.signon_realm) |
203 forms->push_back(new PasswordForm(all_forms_[i])); | 205 forms->push_back(new PasswordForm(all_forms_[i])); |
204 return true; | 206 return true; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 580 |
579 INSTANTIATE_TEST_CASE_P(NoBackend, | 581 INSTANTIATE_TEST_CASE_P(NoBackend, |
580 PasswordStoreXTest, | 582 PasswordStoreXTest, |
581 testing::Values(NO_BACKEND)); | 583 testing::Values(NO_BACKEND)); |
582 INSTANTIATE_TEST_CASE_P(FailingBackend, | 584 INSTANTIATE_TEST_CASE_P(FailingBackend, |
583 PasswordStoreXTest, | 585 PasswordStoreXTest, |
584 testing::Values(FAILING_BACKEND)); | 586 testing::Values(FAILING_BACKEND)); |
585 INSTANTIATE_TEST_CASE_P(WorkingBackend, | 587 INSTANTIATE_TEST_CASE_P(WorkingBackend, |
586 PasswordStoreXTest, | 588 PasswordStoreXTest, |
587 testing::Values(WORKING_BACKEND)); | 589 testing::Values(WORKING_BACKEND)); |
OLD | NEW |