OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const std::string& page_url, | 86 const std::string& page_url, |
87 const std::string& arg_url, | 87 const std::string& arg_url, |
88 const int days_ago, | 88 const int days_ago, |
89 const base::Callback | 89 const base::Callback |
90 <void(scoped_ptr<Action::ActionVector>)>& callback) = 0; | 90 <void(scoped_ptr<Action::ActionVector>)>& callback) = 0; |
91 | 91 |
92 // Clean the relevant URL data. The cleaning may need to be different for | 92 // Clean the relevant URL data. The cleaning may need to be different for |
93 // different policies. If restrict_urls is empty then all URLs are removed. | 93 // different policies. If restrict_urls is empty then all URLs are removed. |
94 virtual void RemoveURLs(const std::vector<GURL>& restrict_urls) = 0; | 94 virtual void RemoveURLs(const std::vector<GURL>& restrict_urls) = 0; |
95 | 95 |
96 // Remove all rows relating to a given extension. | |
97 virtual void RemoveExtensionData(const std::string& extension_id) = 0; | |
98 | |
99 // Deletes everything in the database. | 96 // Deletes everything in the database. |
100 virtual void DeleteDatabase() = 0; | 97 virtual void DeleteDatabase() = 0; |
101 | 98 |
102 // For unit testing only. | 99 // For unit testing only. |
103 void SetClockForTesting(scoped_ptr<base::Clock> clock); | 100 void SetClockForTesting(scoped_ptr<base::Clock> clock); |
104 | 101 |
105 // A collection of methods that are useful for implementing policies. These | 102 // A collection of methods that are useful for implementing policies. These |
106 // are all static methods; the ActivityLogPolicy::Util class cannot be | 103 // are all static methods; the ActivityLogPolicy::Util class cannot be |
107 // instantiated. This is nested within ActivityLogPolicy to make calling | 104 // instantiated. This is nested within ActivityLogPolicy to make calling |
108 // these methods more convenient from within a policy, but they are public. | 105 // these methods more convenient from within a policy, but they are public. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 217 |
221 private: | 218 private: |
222 // See the comments for the ActivityDatabase class for a discussion of how | 219 // See the comments for the ActivityDatabase class for a discussion of how |
223 // database cleanup runs. | 220 // database cleanup runs. |
224 ActivityDatabase* db_; | 221 ActivityDatabase* db_; |
225 }; | 222 }; |
226 | 223 |
227 } // namespace extensions | 224 } // namespace extensions |
228 | 225 |
229 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ | 226 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ |
OLD | NEW |