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 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 // All Get* methods below overwrite |forms| with the returned credentials. On | 85 // All Get* methods below overwrite |forms| with the returned credentials. On |
86 // success, those methods return true. | 86 // success, those methods return true. |
87 | 87 |
88 // Gets a list of credentials matching |form|, including blacklisted matches | 88 // Gets a list of credentials matching |form|, including blacklisted matches |
89 // and federated credentials. | 89 // and federated credentials. |
90 bool GetLogins(const PasswordStore::FormDigest& form, | 90 bool GetLogins(const PasswordStore::FormDigest& form, |
91 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) | 91 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) |
92 const WARN_UNUSED_RESULT; | 92 const WARN_UNUSED_RESULT; |
93 | 93 |
| 94 // Retrieves all stored credentials with SCHEME_HTTP that have a realm whose |
| 95 // organization-identifying name -- that is, the first domain name label below |
| 96 // the effective TLD -- matches that of |signon_realm|. Return value indicates |
| 97 // a successful query (but potentially no results). |
| 98 // |
| 99 // For example, the organization-identifying name of "https://foo.example.org" |
| 100 // is `example`, and logins will be returned for "http://bar.example.co.uk", |
| 101 // but not for "http://notexample.com" or "https://example.foo.com". |
| 102 bool GetLoginsForSameOrganizationName( |
| 103 const std::string& signon_realm, |
| 104 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) const; |
| 105 |
94 // Gets all logins created from |begin| onwards (inclusive) and before |end|. | 106 // Gets all logins created from |begin| onwards (inclusive) and before |end|. |
95 // You may use a null Time value to do an unbounded search in either | 107 // You may use a null Time value to do an unbounded search in either |
96 // direction. | 108 // direction. |
97 bool GetLoginsCreatedBetween( | 109 bool GetLoginsCreatedBetween( |
98 base::Time begin, | 110 base::Time begin, |
99 base::Time end, | 111 base::Time end, |
100 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) const | 112 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) const |
101 WARN_UNUSED_RESULT; | 113 WARN_UNUSED_RESULT; |
102 | 114 |
103 // Gets all logins synced from |begin| onwards (inclusive) and before |end|. | 115 // Gets all logins synced from |begin| onwards (inclusive) and before |end|. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // These cached strings are used to build SQL statements. | 229 // These cached strings are used to build SQL statements. |
218 std::string add_statement_; | 230 std::string add_statement_; |
219 std::string add_replace_statement_; | 231 std::string add_replace_statement_; |
220 std::string update_statement_; | 232 std::string update_statement_; |
221 std::string delete_statement_; | 233 std::string delete_statement_; |
222 std::string autosignin_statement_; | 234 std::string autosignin_statement_; |
223 std::string get_statement_; | 235 std::string get_statement_; |
224 std::string get_statement_psl_; | 236 std::string get_statement_psl_; |
225 std::string get_statement_federated_; | 237 std::string get_statement_federated_; |
226 std::string get_statement_psl_federated_; | 238 std::string get_statement_psl_federated_; |
| 239 std::string get_same_organization_name_logins_statement_; |
227 std::string created_statement_; | 240 std::string created_statement_; |
228 std::string synced_statement_; | 241 std::string synced_statement_; |
229 std::string blacklisted_statement_; | 242 std::string blacklisted_statement_; |
230 std::string encrypted_statement_; | 243 std::string encrypted_statement_; |
231 | 244 |
232 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); | 245 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); |
233 }; | 246 }; |
234 | 247 |
235 } // namespace password_manager | 248 } // namespace password_manager |
236 | 249 |
237 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ | 250 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ |
OLD | NEW |