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_FULLSTREAM_UI_POLICY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/extensions/activity_log/activity_database.h" | 10 #include "chrome/browser/extensions/activity_log/activity_database.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 const std::string& arg_url, | 36 const std::string& arg_url, |
37 const int days_ago, | 37 const int days_ago, |
38 const base::Callback | 38 const base::Callback |
39 <void(scoped_ptr<Action::ActionVector>)>& callback) OVERRIDE; | 39 <void(scoped_ptr<Action::ActionVector>)>& callback) OVERRIDE; |
40 | 40 |
41 virtual void Close() OVERRIDE; | 41 virtual void Close() OVERRIDE; |
42 | 42 |
43 // Clean the URL data stored for this policy. | 43 // Clean the URL data stored for this policy. |
44 virtual void RemoveURLs(const std::vector<GURL>& restrict_urls) OVERRIDE; | 44 virtual void RemoveURLs(const std::vector<GURL>& restrict_urls) OVERRIDE; |
45 | 45 |
| 46 // Clean the data related to this extension for this policy. |
| 47 virtual void RemoveExtensionData(const std::string& extension_id) OVERRIDE; |
| 48 |
46 // Delete everything in the database. | 49 // Delete everything in the database. |
47 virtual void DeleteDatabase() OVERRIDE; | 50 virtual void DeleteDatabase() OVERRIDE; |
48 | 51 |
49 // Database table schema. | 52 // Database table schema. |
50 static const char* kTableName; | 53 static const char* kTableName; |
51 static const char* kTableContentFields[]; | 54 static const char* kTableContentFields[]; |
52 static const char* kTableFieldTypes[]; | 55 static const char* kTableFieldTypes[]; |
53 static const int kTableFieldCount; | 56 static const int kTableFieldCount; |
54 | 57 |
55 protected: | 58 protected: |
(...skipping 11 matching lines...) Expand all Loading... |
67 // Strips arguments if needed by policy. May return the original object (if | 70 // Strips arguments if needed by policy. May return the original object (if |
68 // unmodified), or a copy (if modifications were made). The implementation | 71 // unmodified), or a copy (if modifications were made). The implementation |
69 // in FullStreamUIPolicy returns the action unmodified. | 72 // in FullStreamUIPolicy returns the action unmodified. |
70 virtual scoped_refptr<Action> ProcessArguments( | 73 virtual scoped_refptr<Action> ProcessArguments( |
71 scoped_refptr<Action> action) const; | 74 scoped_refptr<Action> action) const; |
72 | 75 |
73 // The implementation of RemoveURLs; this must only run on the database | 76 // The implementation of RemoveURLs; this must only run on the database |
74 // thread. | 77 // thread. |
75 void DoRemoveURLs(const std::vector<GURL>& restrict_urls); | 78 void DoRemoveURLs(const std::vector<GURL>& restrict_urls); |
76 | 79 |
| 80 // The implementation of RemoveExtensionData; this must only run on the |
| 81 // database thread. |
| 82 void DoRemoveExtensionData(const std::string& extension_id); |
| 83 |
77 // The implementation of DeleteDatabase; this must only run on the database | 84 // The implementation of DeleteDatabase; this must only run on the database |
78 // thread. | 85 // thread. |
79 void DoDeleteDatabase(); | 86 void DoDeleteDatabase(); |
80 | 87 |
81 // Tracks any pending updates to be written to the database, if write | 88 // Tracks any pending updates to be written to the database, if write |
82 // batching is turned on. Should only be accessed from the database thread. | 89 // batching is turned on. Should only be accessed from the database thread. |
83 Action::ActionVector queued_actions_; | 90 Action::ActionVector queued_actions_; |
84 | 91 |
85 private: | 92 private: |
86 // Adds an Action to queued_actions_; this should be invoked only on the | 93 // Adds an Action to queued_actions_; this should be invoked only on the |
87 // database thread. | 94 // database thread. |
88 void QueueAction(scoped_refptr<Action> action); | 95 void QueueAction(scoped_refptr<Action> action); |
89 | 96 |
90 // Internal method to read data from the database; called on the database | 97 // Internal method to read data from the database; called on the database |
91 // thread. | 98 // thread. |
92 scoped_ptr<Action::ActionVector> DoReadFilteredData( | 99 scoped_ptr<Action::ActionVector> DoReadFilteredData( |
93 const std::string& extension_id, | 100 const std::string& extension_id, |
94 const Action::ActionType type, | 101 const Action::ActionType type, |
95 const std::string& api_name, | 102 const std::string& api_name, |
96 const std::string& page_url, | 103 const std::string& page_url, |
97 const std::string& arg_url, | 104 const std::string& arg_url, |
98 const int days_ago); | 105 const int days_ago); |
99 }; | 106 }; |
100 | 107 |
101 } // namespace extensions | 108 } // namespace extensions |
102 | 109 |
103 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ | 110 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ |
OLD | NEW |