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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Reports usage metrics to UMA. | 33 // Reports usage metrics to UMA. |
34 void ReportMetrics(); | 34 void ReportMetrics(); |
35 | 35 |
36 // Adds |form| to the list of remembered password forms. Returns the list of | 36 // Adds |form| to the list of remembered password forms. Returns the list of |
37 // changes applied ({}, {ADD}, {REMOVE, ADD}). If it returns {REMOVE, ADD} | 37 // changes applied ({}, {ADD}, {REMOVE, ADD}). If it returns {REMOVE, ADD} |
38 // then the REMOVE is associated with the form that was added. Thus only the | 38 // then the REMOVE is associated with the form that was added. Thus only the |
39 // primary key columns contain the values associated with the removed form. | 39 // primary key columns contain the values associated with the removed form. |
40 PasswordStoreChangeList AddLogin(const autofill::PasswordForm& form); | 40 PasswordStoreChangeList AddLogin(const autofill::PasswordForm& form); |
41 | 41 |
42 // Updates remembered password form. Returns true on success and sets | 42 // Updates existing password form. Returns the list of applied changes |
43 // items_changed (if non-NULL) to the number of logins updated. | 43 // ({}, {UPDATE}). The password is looked up by the tuple {origin, |
44 bool UpdateLogin(const autofill::PasswordForm& form, int* items_changed); | 44 // username_element, username_value, password_element, signon_realm}. |
| 45 // These columns stay intact. |
| 46 PasswordStoreChangeList UpdateLogin(const autofill::PasswordForm& form); |
45 | 47 |
46 // Removes |form| from the list of remembered password forms. | 48 // Removes |form| from the list of remembered password forms. |
47 bool RemoveLogin(const autofill::PasswordForm& form); | 49 bool RemoveLogin(const autofill::PasswordForm& form); |
48 | 50 |
49 // Removes all logins created from |delete_begin| onwards (inclusive) and | 51 // Removes all logins created from |delete_begin| onwards (inclusive) and |
50 // before |delete_end|. You may use a null Time value to do an unbounded | 52 // before |delete_end|. You may use a null Time value to do an unbounded |
51 // delete in either direction. | 53 // delete in either direction. |
52 bool RemoveLoginsCreatedBetween(const base::Time delete_begin, | 54 bool RemoveLoginsCreatedBetween(const base::Time delete_begin, |
53 const base::Time delete_end); | 55 const base::Time delete_end); |
54 | 56 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 sql::MetaTable meta_table_; | 133 sql::MetaTable meta_table_; |
132 | 134 |
133 PSLMatchingHelper psl_helper_; | 135 PSLMatchingHelper psl_helper_; |
134 | 136 |
135 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); | 137 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); |
136 }; | 138 }; |
137 | 139 |
138 } // namespace password_manager | 140 } // namespace password_manager |
139 | 141 |
140 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ | 142 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ |
OLD | NEW |