| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_PASSWORD_MANAGER_LOGIN_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_LOGIN_DATABASE_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_LOGIN_DATABASE_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_LOGIN_DATABASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // the login information. | 21 // the login information. |
| 22 class LoginDatabase { | 22 class LoginDatabase { |
| 23 public: | 23 public: |
| 24 LoginDatabase(); | 24 LoginDatabase(); |
| 25 virtual ~LoginDatabase(); | 25 virtual ~LoginDatabase(); |
| 26 | 26 |
| 27 // Initialize the database with an sqlite file at the given path. | 27 // Initialize the database with an sqlite file at the given path. |
| 28 // If false is returned, no other method should be called. | 28 // If false is returned, no other method should be called. |
| 29 bool Init(const FilePath& db_path); | 29 bool Init(const FilePath& db_path); |
| 30 | 30 |
| 31 // Reports usage metrics to UMA. |
| 32 void ReportMetrics(); |
| 33 |
| 31 // Adds |form| to the list of remembered password forms. | 34 // Adds |form| to the list of remembered password forms. |
| 32 bool AddLogin(const webkit_glue::PasswordForm& form); | 35 bool AddLogin(const webkit_glue::PasswordForm& form); |
| 33 | 36 |
| 34 // Updates remembered password form. Returns true on success and sets | 37 // Updates remembered password form. Returns true on success and sets |
| 35 // items_changed (if non-NULL) to the number of logins updated. | 38 // items_changed (if non-NULL) to the number of logins updated. |
| 36 bool UpdateLogin(const webkit_glue::PasswordForm& form, int* items_changed); | 39 bool UpdateLogin(const webkit_glue::PasswordForm& form, int* items_changed); |
| 37 | 40 |
| 38 // Removes |form| from the list of remembered password forms. | 41 // Removes |form| from the list of remembered password forms. |
| 39 bool RemoveLogin(const webkit_glue::PasswordForm& form); | 42 bool RemoveLogin(const webkit_glue::PasswordForm& form); |
| 40 | 43 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 bool blacklisted, std::vector<webkit_glue::PasswordForm*>* forms) const; | 90 bool blacklisted, std::vector<webkit_glue::PasswordForm*>* forms) const; |
| 88 | 91 |
| 89 mutable sql::Connection db_; | 92 mutable sql::Connection db_; |
| 90 sql::MetaTable meta_table_; | 93 sql::MetaTable meta_table_; |
| 91 | 94 |
| 92 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); | 95 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); |
| 93 }; | 96 }; |
| 94 | 97 |
| 95 | 98 |
| 96 #endif // CHROME_BROWSER_PASSWORD_MANAGER_LOGIN_DATABASE_H_ | 99 #endif // CHROME_BROWSER_PASSWORD_MANAGER_LOGIN_DATABASE_H_ |
| OLD | NEW |