| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // prefixes; other fields are exact matches. Empty strings are not matched to | 77 // prefixes; other fields are exact matches. Empty strings are not matched to |
| 78 // anything. For daysAgo, today is 0, yesterday is 1, etc.; a negative number | 78 // anything. For daysAgo, today is 0, yesterday is 1, etc.; a negative number |
| 79 // of days is treated as a missing parameter. | 79 // of days is treated as a missing parameter. |
| 80 void GetFilteredActions( | 80 void GetFilteredActions( |
| 81 const std::string& extension_id, | 81 const std::string& extension_id, |
| 82 const Action::ActionType type, | 82 const Action::ActionType type, |
| 83 const std::string& api_name, | 83 const std::string& api_name, |
| 84 const std::string& page_url, | 84 const std::string& page_url, |
| 85 const std::string& arg_url, | 85 const std::string& arg_url, |
| 86 const int days_ago, | 86 const int days_ago, |
| 87 const base::Callback | 87 const base::Callback< |
| 88 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback); | 88 void(std::unique_ptr<std::vector<scoped_refptr<Action>>>)>& callback); |
| 89 | 89 |
| 90 // ExtensionRegistryObserver. | 90 // ExtensionRegistryObserver. |
| 91 // We keep track of whether the whitelisted extension is installed; if it is, | 91 // We keep track of whether the whitelisted extension is installed; if it is, |
| 92 // we want to recompute whether to have logging enabled. | 92 // we want to recompute whether to have logging enabled. |
| 93 void OnExtensionLoaded(content::BrowserContext* browser_context, | 93 void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 94 const Extension* extension) override; | 94 const Extension* extension) override; |
| 95 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 95 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 96 const Extension* extension, | 96 const Extension* extension, |
| 97 UnloadedExtensionInfo::Reason reason) override; | 97 UnloadedExtensionInfo::Reason reason) override; |
| 98 void OnExtensionUninstalled(content::BrowserContext* browser_context, | 98 void OnExtensionUninstalled(content::BrowserContext* browser_context, |
| 99 const Extension* extension, | 99 const Extension* extension, |
| 100 extensions::UninstallReason reason) override; | 100 extensions::UninstallReason reason) override; |
| 101 | 101 |
| 102 // ApiActivityMonitor. | 102 // ApiActivityMonitor. |
| 103 void OnApiEventDispatched(const std::string& extension_id, | 103 void OnApiEventDispatched( |
| 104 const std::string& event_name, | 104 const std::string& extension_id, |
| 105 scoped_ptr<base::ListValue> event_args) override; | 105 const std::string& event_name, |
| 106 void OnApiFunctionCalled(const std::string& extension_id, | 106 std::unique_ptr<base::ListValue> event_args) override; |
| 107 const std::string& api_name, | 107 void OnApiFunctionCalled( |
| 108 scoped_ptr<base::ListValue> event_args) override; | 108 const std::string& extension_id, |
| 109 const std::string& api_name, |
| 110 std::unique_ptr<base::ListValue> event_args) override; |
| 109 | 111 |
| 110 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 112 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 111 | 113 |
| 112 // Remove actions from the activity log database which IDs specified in the | 114 // Remove actions from the activity log database which IDs specified in the |
| 113 // action_ids array. | 115 // action_ids array. |
| 114 void RemoveActions(const std::vector<int64_t>& action_ids); | 116 void RemoveActions(const std::vector<int64_t>& action_ids); |
| 115 | 117 |
| 116 // Clean up URLs from the activity log database. | 118 // Clean up URLs from the activity log database. |
| 117 // If restrict_urls is empty then all URLs in the activity log database are | 119 // If restrict_urls is empty then all URLs in the activity log database are |
| 118 // removed, otherwise only those in restrict_urls are removed. | 120 // removed, otherwise only those in restrict_urls are removed. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 FRIEND_TEST_ALL_PREFIXES(ActivityLogEnabledTest, WatchdogSwitch); | 210 FRIEND_TEST_ALL_PREFIXES(ActivityLogEnabledTest, WatchdogSwitch); |
| 209 DISALLOW_COPY_AND_ASSIGN(ActivityLog); | 211 DISALLOW_COPY_AND_ASSIGN(ActivityLog); |
| 210 }; | 212 }; |
| 211 | 213 |
| 212 template <> | 214 template <> |
| 213 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies(); | 215 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies(); |
| 214 | 216 |
| 215 } // namespace extensions | 217 } // namespace extensions |
| 216 | 218 |
| 217 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ | 219 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ |
| OLD | NEW |