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 #include "chrome/browser/extensions/extension_function_registry.h" | 5 #include "chrome/browser/extensions/extension_function_registry.h" |
6 | 6 |
7 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" | |
8 #include "chrome/browser/extensions/api/identity/experimental_identity_api.h" | 7 #include "chrome/browser/extensions/api/identity/experimental_identity_api.h" |
9 #include "chrome/browser/extensions/api/preference/chrome_direct_setting.h" | 8 #include "chrome/browser/extensions/api/preference/chrome_direct_setting.h" |
10 #include "chrome/browser/extensions/api/preference/preference_api.h" | 9 #include "chrome/browser/extensions/api/preference/preference_api.h" |
11 #include "chrome/browser/extensions/api/runtime/runtime_api.h" | 10 #include "chrome/browser/extensions/api/runtime/runtime_api.h" |
12 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 11 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
13 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" | 12 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" |
14 #include "chrome/browser/rlz/rlz_extension_api.h" | 13 #include "chrome/browser/rlz/rlz_extension_api.h" |
15 #include "chrome/common/extensions/api/generated_api.h" | 14 #include "chrome/common/extensions/api/generated_api.h" |
16 | 15 |
17 // static | 16 // static |
18 ExtensionFunctionRegistry* ExtensionFunctionRegistry::GetInstance() { | 17 ExtensionFunctionRegistry* ExtensionFunctionRegistry::GetInstance() { |
19 return Singleton<ExtensionFunctionRegistry>::get(); | 18 return Singleton<ExtensionFunctionRegistry>::get(); |
20 } | 19 } |
21 | 20 |
22 ExtensionFunctionRegistry::ExtensionFunctionRegistry() { | 21 ExtensionFunctionRegistry::ExtensionFunctionRegistry() { |
23 ResetFunctions(); | 22 ResetFunctions(); |
24 } | 23 } |
25 | 24 |
26 ExtensionFunctionRegistry::~ExtensionFunctionRegistry() { | 25 ExtensionFunctionRegistry::~ExtensionFunctionRegistry() { |
27 } | 26 } |
28 | 27 |
29 void ExtensionFunctionRegistry::ResetFunctions() { | 28 void ExtensionFunctionRegistry::ResetFunctions() { |
30 #if defined(ENABLE_EXTENSIONS) | 29 #if defined(ENABLE_EXTENSIONS) |
31 | 30 |
32 // Register all functions here. | 31 // Register all functions here. |
33 | 32 |
34 // Browsing Data. | |
35 RegisterFunction<BrowsingDataSettingsFunction>(); | |
36 RegisterFunction<RemoveBrowsingDataFunction>(); | |
37 RegisterFunction<RemoveAppCacheFunction>(); | |
38 RegisterFunction<RemoveCacheFunction>(); | |
39 RegisterFunction<RemoveCookiesFunction>(); | |
40 RegisterFunction<RemoveDownloadsFunction>(); | |
41 RegisterFunction<RemoveFileSystemsFunction>(); | |
42 RegisterFunction<RemoveFormDataFunction>(); | |
43 RegisterFunction<RemoveHistoryFunction>(); | |
44 RegisterFunction<RemoveIndexedDBFunction>(); | |
45 RegisterFunction<RemoveLocalStorageFunction>(); | |
46 RegisterFunction<RemovePluginDataFunction>(); | |
47 RegisterFunction<RemovePasswordsFunction>(); | |
48 RegisterFunction<RemoveWebSQLFunction>(); | |
49 | |
50 // RLZ (not supported on ChromeOS yet). | 33 // RLZ (not supported on ChromeOS yet). |
51 #if defined(ENABLE_RLZ) && !defined(OS_CHROMEOS) | 34 #if defined(ENABLE_RLZ) && !defined(OS_CHROMEOS) |
52 RegisterFunction<RlzRecordProductEventFunction>(); | 35 RegisterFunction<RlzRecordProductEventFunction>(); |
53 RegisterFunction<RlzGetAccessPointRlzFunction>(); | 36 RegisterFunction<RlzGetAccessPointRlzFunction>(); |
54 RegisterFunction<RlzSendFinancialPingFunction>(); | 37 RegisterFunction<RlzSendFinancialPingFunction>(); |
55 RegisterFunction<RlzClearProductStateFunction>(); | 38 RegisterFunction<RlzClearProductStateFunction>(); |
56 #endif | 39 #endif |
57 | 40 |
58 // WebRequest. | 41 // WebRequest. |
59 RegisterFunction<WebRequestAddEventListener>(); | 42 RegisterFunction<WebRequestAddEventListener>(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 113 |
131 ExtensionFunctionRegistry::FactoryEntry::FactoryEntry() | 114 ExtensionFunctionRegistry::FactoryEntry::FactoryEntry() |
132 : factory_(0), histogram_value_(extensions::functions::UNKNOWN) { | 115 : factory_(0), histogram_value_(extensions::functions::UNKNOWN) { |
133 } | 116 } |
134 | 117 |
135 ExtensionFunctionRegistry::FactoryEntry::FactoryEntry( | 118 ExtensionFunctionRegistry::FactoryEntry::FactoryEntry( |
136 ExtensionFunctionFactory factory, | 119 ExtensionFunctionFactory factory, |
137 extensions::functions::HistogramValue histogram_value) | 120 extensions::functions::HistogramValue histogram_value) |
138 : factory_(factory), histogram_value_(histogram_value) { | 121 : factory_(factory), histogram_value_(histogram_value) { |
139 } | 122 } |
OLD | NEW |