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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 const std::string& api_name, | 98 const std::string& api_name, |
99 const std::string& page_url, | 99 const std::string& page_url, |
100 const std::string& arg_url, | 100 const std::string& arg_url, |
101 const base::Callback | 101 const base::Callback |
102 <void(scoped_ptr<Action::ActionVector>)>& callback) = 0; | 102 <void(scoped_ptr<Action::ActionVector>)>& callback) = 0; |
103 | 103 |
104 // Clean the relevant URL data. The cleaning may need to be different for | 104 // Clean the relevant URL data. The cleaning may need to be different for |
105 // different policies. If restrict_urls is empty then all URLs are removed. | 105 // different policies. If restrict_urls is empty then all URLs are removed. |
106 virtual void RemoveURLs(const std::vector<GURL>& restrict_urls) = 0; | 106 virtual void RemoveURLs(const std::vector<GURL>& restrict_urls) = 0; |
107 | 107 |
| 108 // Deletes everything in the database. |
| 109 virtual void DeleteDatabase() = 0; |
| 110 |
108 // For unit testing only. | 111 // For unit testing only. |
109 void SetClockForTesting(scoped_ptr<base::Clock> clock); | 112 void SetClockForTesting(scoped_ptr<base::Clock> clock); |
110 | 113 |
111 // A collection of methods that are useful for implementing policies. These | 114 // A collection of methods that are useful for implementing policies. These |
112 // are all static methods; the ActivityLogPolicy::Util class cannot be | 115 // are all static methods; the ActivityLogPolicy::Util class cannot be |
113 // instantiated. This is nested within ActivityLogPolicy to make calling | 116 // instantiated. This is nested within ActivityLogPolicy to make calling |
114 // these methods more convenient from within a policy, but they are public. | 117 // these methods more convenient from within a policy, but they are public. |
115 class Util { | 118 class Util { |
116 public: | 119 public: |
117 // Serialize a Value as a JSON string. Returns an empty string if value is | 120 // Serialize a Value as a JSON string. Returns an empty string if value is |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 225 |
223 private: | 226 private: |
224 // See the comments for the ActivityDatabase class for a discussion of how | 227 // See the comments for the ActivityDatabase class for a discussion of how |
225 // database cleanup runs. | 228 // database cleanup runs. |
226 ActivityDatabase* db_; | 229 ActivityDatabase* db_; |
227 }; | 230 }; |
228 | 231 |
229 } // namespace extensions | 232 } // namespace extensions |
230 | 233 |
231 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ | 234 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ |
OLD | NEW |