Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 namespace password_manager { | 29 namespace password_manager { |
| 30 | 30 |
| 31 extern const int kCurrentVersionNumber; | 31 extern const int kCurrentVersionNumber; |
| 32 extern const int kCompatibleVersionNumber; | 32 extern const int kCompatibleVersionNumber; |
| 33 | 33 |
| 34 // Interface to the database storage of login information, intended as a helper | 34 // Interface to the database storage of login information, intended as a helper |
| 35 // for PasswordStore on platforms that need internal storage of some or all of | 35 // for PasswordStore on platforms that need internal storage of some or all of |
| 36 // the login information. | 36 // the login information. |
| 37 class LoginDatabase { | 37 class LoginDatabase { |
| 38 public: | 38 public: |
| 39 LoginDatabase(const base::FilePath& db_path); | 39 explicit LoginDatabase(const base::FilePath& db_path); |
| 40 virtual ~LoginDatabase(); | 40 virtual ~LoginDatabase(); |
| 41 | 41 |
| 42 // Actually creates/opens the database. If false is returned, no other method | 42 // Actually creates/opens the database. If false is returned, no other method |
| 43 // should be called. | 43 // should be called. |
| 44 virtual bool Init(); | 44 virtual bool Init(); |
| 45 | 45 |
| 46 // Reports usage metrics to UMA. | 46 // Reports usage metrics to UMA. |
| 47 void ReportMetrics(const std::string& sync_username, | 47 void ReportMetrics(const std::string& sync_username, |
| 48 bool custom_passphrase_sync_enabled); | 48 bool custom_passphrase_sync_enabled); |
| 49 | 49 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 | 172 |
| 173 bool InitLoginsTable(); | 173 bool InitLoginsTable(); |
| 174 bool MigrateOldVersionsAsNeeded(); | 174 bool MigrateOldVersionsAsNeeded(); |
| 175 | 175 |
| 176 // Fills |form| from the values in the given statement (which is assumed to | 176 // Fills |form| from the values in the given statement (which is assumed to |
| 177 // be of the form used by the Get*Logins methods). | 177 // be of the form used by the Get*Logins methods). |
| 178 // Returns the EncryptionResult from decrypting the password in |s|; if not | 178 // Returns the EncryptionResult from decrypting the password in |s|; if not |
| 179 // ENCRYPTION_RESULT_SUCCESS, |form| is not filled. | 179 // ENCRYPTION_RESULT_SUCCESS, |form| is not filled. |
| 180 static EncryptionResult InitPasswordFormFromStatement( | 180 static EncryptionResult InitPasswordFormFromStatement( |
| 181 autofill::PasswordForm* form, | 181 autofill::PasswordForm* form, |
| 182 sql::Statement& s); | 182 sql::Statement* s); |
|
msramek
2016/07/11 11:28:08
Should we make this const?
(which would actually
vabr (Chromium)
2016/07/11 12:42:32
Done, including the yak-shaving to make it possibl
| |
| 183 | 183 |
| 184 // Gets all blacklisted or all non-blacklisted (depending on |blacklisted|) | 184 // Gets all blacklisted or all non-blacklisted (depending on |blacklisted|) |
| 185 // credentials. On success returns true and overwrites |forms| with the | 185 // credentials. On success returns true and overwrites |forms| with the |
| 186 // result. | 186 // result. |
| 187 bool GetAllLoginsWithBlacklistSetting( | 187 bool GetAllLoginsWithBlacklistSetting( |
| 188 bool blacklisted, | 188 bool blacklisted, |
| 189 ScopedVector<autofill::PasswordForm>* forms) const; | 189 ScopedVector<autofill::PasswordForm>* forms) const; |
| 190 | 190 |
| 191 // Overwrites |forms| with credentials retrieved from |statement|. If | 191 // Overwrites |forms| with credentials retrieved from |statement|. If |
| 192 // |matched_form| is not null, filters out all results but those PSL-matching | 192 // |matched_form| is not null, filters out all results but those PSL-matching |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 206 // This is a temporary measure for migration the Keychain on Mac. | 206 // This is a temporary measure for migration the Keychain on Mac. |
| 207 // crbug.com/466638 | 207 // crbug.com/466638 |
| 208 bool clear_password_values_; | 208 bool clear_password_values_; |
| 209 | 209 |
| 210 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); | 210 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 } // namespace password_manager | 213 } // namespace password_manager |
| 214 | 214 |
| 215 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ | 215 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ |
| OLD | NEW |