OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_STATISTICS_TABLE_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_STATISTICS_TABLE_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_STATISTICS_TABLE_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_STATISTICS_TABLE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 bool MigrateToVersion(int version); | 61 bool MigrateToVersion(int version); |
62 | 62 |
63 // Adds or replaces the statistics about |stats.origin_domain| and | 63 // Adds or replaces the statistics about |stats.origin_domain| and |
64 // |stats.username_value|. | 64 // |stats.username_value|. |
65 bool AddRow(const InteractionsStats& stats); | 65 bool AddRow(const InteractionsStats& stats); |
66 | 66 |
67 // Removes the statistics for |domain|. Returns true if the SQL completed | 67 // Removes the statistics for |domain|. Returns true if the SQL completed |
68 // successfully. | 68 // successfully. |
69 bool RemoveRow(const GURL& domain); | 69 bool RemoveRow(const GURL& domain); |
70 | 70 |
| 71 // Returns all statistics from the database. |
| 72 std::vector<InteractionsStats> GetAllRows(); |
| 73 |
71 // Returns the statistics for |domain| if it exists. | 74 // Returns the statistics for |domain| if it exists. |
72 std::vector<InteractionsStats> GetRows(const GURL& domain); | 75 std::vector<InteractionsStats> GetRows(const GURL& domain); |
73 | 76 |
74 // Removes the statistics between the dates. If |origin_filter| is not null, | 77 // Removes the statistics between the dates. If |origin_filter| is not null, |
75 // only statistics for matching origins are removed. Returns true if the SQL | 78 // only statistics for matching origins are removed. Returns true if the SQL |
76 // completed successfully. | 79 // completed successfully. |
77 bool RemoveStatsByOriginAndTime( | 80 bool RemoveStatsByOriginAndTime( |
78 const base::Callback<bool(const GURL&)>& origin_filter, | 81 const base::Callback<bool(const GURL&)>& origin_filter, |
79 base::Time delete_begin, | 82 base::Time delete_begin, |
80 base::Time delete_end); | 83 base::Time delete_end); |
81 | 84 |
82 private: | 85 private: |
83 sql::Connection* db_; | 86 sql::Connection* db_; |
84 | 87 |
85 DISALLOW_COPY_AND_ASSIGN(StatisticsTable); | 88 DISALLOW_COPY_AND_ASSIGN(StatisticsTable); |
86 }; | 89 }; |
87 | 90 |
88 } // namespace password_manager | 91 } // namespace password_manager |
89 | 92 |
90 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_STATISTICS_TABLE_H_ | 93 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_STATISTICS_TABLE_H_ |
OLD | NEW |