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_PASSWORD_STORE_DEFAULT_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_DEFAULT_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_DEFAULT_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_DEFAULT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 base::Time delete_begin, | 65 base::Time delete_begin, |
66 base::Time delete_end) override; | 66 base::Time delete_end) override; |
67 std::vector<std::unique_ptr<autofill::PasswordForm>> FillMatchingLogins( | 67 std::vector<std::unique_ptr<autofill::PasswordForm>> FillMatchingLogins( |
68 const FormDigest& form) override; | 68 const FormDigest& form) override; |
69 bool FillAutofillableLogins( | 69 bool FillAutofillableLogins( |
70 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; | 70 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; |
71 bool FillBlacklistLogins( | 71 bool FillBlacklistLogins( |
72 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; | 72 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; |
73 void AddSiteStatsImpl(const InteractionsStats& stats) override; | 73 void AddSiteStatsImpl(const InteractionsStats& stats) override; |
74 void RemoveSiteStatsImpl(const GURL& origin_domain) override; | 74 void RemoveSiteStatsImpl(const GURL& origin_domain) override; |
| 75 std::vector<InteractionsStats> GetAllSiteStatsImpl() override; |
75 std::vector<InteractionsStats> GetSiteStatsImpl( | 76 std::vector<InteractionsStats> GetSiteStatsImpl( |
76 const GURL& origin_domain) override; | 77 const GURL& origin_domain) override; |
77 | 78 |
78 inline bool DeleteAndRecreateDatabaseFile() { | 79 inline bool DeleteAndRecreateDatabaseFile() { |
79 return login_db_->DeleteAndRecreateDatabaseFile(); | 80 return login_db_->DeleteAndRecreateDatabaseFile(); |
80 } | 81 } |
81 | 82 |
82 void set_login_db(std::unique_ptr<password_manager::LoginDatabase> login_db) { | 83 void set_login_db(std::unique_ptr<password_manager::LoginDatabase> login_db) { |
83 login_db_.swap(login_db); | 84 login_db_.swap(login_db); |
84 } | 85 } |
85 | 86 |
86 private: | 87 private: |
87 // Resets |login_db_| on the background thread. | 88 // Resets |login_db_| on the background thread. |
88 void ResetLoginDB(); | 89 void ResetLoginDB(); |
89 | 90 |
90 // The login SQL database. The LoginDatabase instance is received via the | 91 // The login SQL database. The LoginDatabase instance is received via the |
91 // in an uninitialized state, so as to allow injecting mocks, then Init() is | 92 // in an uninitialized state, so as to allow injecting mocks, then Init() is |
92 // called on the DB thread in a deferred manner. If opening the DB fails, | 93 // called on the DB thread in a deferred manner. If opening the DB fails, |
93 // |login_db_| will be reset and stay NULL for the lifetime of |this|. | 94 // |login_db_| will be reset and stay NULL for the lifetime of |this|. |
94 std::unique_ptr<LoginDatabase> login_db_; | 95 std::unique_ptr<LoginDatabase> login_db_; |
95 | 96 |
96 DISALLOW_COPY_AND_ASSIGN(PasswordStoreDefault); | 97 DISALLOW_COPY_AND_ASSIGN(PasswordStoreDefault); |
97 }; | 98 }; |
98 | 99 |
99 } // namespace password_manager | 100 } // namespace password_manager |
100 | 101 |
101 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_DEFAULT_H_ | 102 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_DEFAULT_H_ |
OLD | NEW |