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/accessibility/accessibility_extension_api.h" | 7 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
8 #include "chrome/browser/extensions/api/app/app_api.h" | 8 #include "chrome/browser/extensions/api/app/app_api.h" |
9 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" | 9 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" |
10 #include "chrome/browser/extensions/api/bookmarks/bookmark_api.h" | |
11 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" | 10 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" |
12 #include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_
api.h" | |
13 #include "chrome/browser/extensions/api/commands/commands.h" | 11 #include "chrome/browser/extensions/api/commands/commands.h" |
14 #include "chrome/browser/extensions/api/content_settings/content_settings_api.h" | |
15 #include "chrome/browser/extensions/api/context_menu/context_menu_api.h" | |
16 #include "chrome/browser/extensions/api/cookies/cookies_api.h" | |
17 #include "chrome/browser/extensions/api/debugger/debugger_api.h" | |
18 #include "chrome/browser/extensions/api/declarative/declarative_api.h" | |
19 #include "chrome/browser/extensions/api/extension_action/extension_browser_actio
ns_api.h" | 12 #include "chrome/browser/extensions/api/extension_action/extension_browser_actio
ns_api.h" |
20 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_
api.h" | 13 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_
api.h" |
21 #include "chrome/browser/extensions/api/extension_action/extension_script_badge_
api.h" | 14 #include "chrome/browser/extensions/api/extension_action/extension_script_badge_
api.h" |
22 #include "chrome/browser/extensions/api/font_settings/font_settings_api.h" | |
23 #include "chrome/browser/extensions/api/history/history_api.h" | |
24 #include "chrome/browser/extensions/api/identity/identity_api.h" | |
25 #include "chrome/browser/extensions/api/i18n/i18n_api.h" | |
26 #include "chrome/browser/extensions/api/idle/idle_api.h" | 15 #include "chrome/browser/extensions/api/idle/idle_api.h" |
27 #include "chrome/browser/extensions/api/managed_mode/managed_mode_api.h" | 16 #include "chrome/browser/extensions/api/managed_mode/managed_mode_api.h" |
28 #include "chrome/browser/extensions/api/management/management_api.h" | |
29 #include "chrome/browser/extensions/api/metrics/metrics.h" | 17 #include "chrome/browser/extensions/api/metrics/metrics.h" |
30 #include "chrome/browser/extensions/api/module/module.h" | 18 #include "chrome/browser/extensions/api/module/module.h" |
31 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 19 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
32 #include "chrome/browser/extensions/api/page_capture/page_capture_api.h" | |
33 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | |
34 #include "chrome/browser/extensions/api/preference/preference_api.h" | 20 #include "chrome/browser/extensions/api/preference/preference_api.h" |
35 #include "chrome/browser/extensions/api/record/record_api.h" | |
36 #include "chrome/browser/extensions/api/runtime/runtime_api.h" | 21 #include "chrome/browser/extensions/api/runtime/runtime_api.h" |
37 #include "chrome/browser/extensions/api/serial/serial_api.h" | |
38 #include "chrome/browser/extensions/api/socket/socket_api.h" | |
39 #include "chrome/browser/extensions/api/tabs/execute_code_in_tab_function.h" | |
40 #include "chrome/browser/extensions/api/tabs/tabs.h" | |
41 #include "chrome/browser/extensions/api/test/test_api.h" | 22 #include "chrome/browser/extensions/api/test/test_api.h" |
42 #include "chrome/browser/extensions/api/top_sites/top_sites_api.h" | 23 #include "chrome/browser/extensions/api/top_sites/top_sites_api.h" |
43 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | |
44 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 24 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
45 #include "chrome/browser/extensions/api/web_socket_proxy_private/web_socket_prox
y_private_api.h" | 25 #include "chrome/browser/extensions/api/web_socket_proxy_private/web_socket_prox
y_private_api.h" |
46 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" | 26 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" |
47 #include "chrome/browser/extensions/settings/settings_api.h" | |
48 #include "chrome/browser/extensions/system/system_api.h" | 27 #include "chrome/browser/extensions/system/system_api.h" |
49 #include "chrome/browser/infobars/infobar_extension_api.h" | 28 #include "chrome/browser/infobars/infobar_extension_api.h" |
50 #include "chrome/browser/rlz/rlz_extension_api.h" | 29 #include "chrome/browser/rlz/rlz_extension_api.h" |
51 #include "chrome/browser/speech/speech_input_extension_api.h" | 30 #include "chrome/browser/speech/speech_input_extension_api.h" |
52 #include "chrome/common/extensions/api/generated_api.h" | 31 #include "chrome/common/extensions/api/generated_api.h" |
53 | 32 |
54 #if defined(TOOLKIT_VIEWS) | 33 #if defined(TOOLKIT_VIEWS) |
55 #include "chrome/browser/extensions/api/input/input.h" | 34 #include "chrome/browser/extensions/api/input/input.h" |
56 #endif | 35 #endif // defined(TOOLKIT_VIEWS) |
57 | 36 |
58 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
59 #include "chrome/browser/chromeos/extensions/echo_private_api.h" | 38 #include "chrome/browser/chromeos/extensions/echo_private_api.h" |
60 #include "chrome/browser/chromeos/extensions/file_browser_handler_api.h" | |
61 #include "chrome/browser/chromeos/extensions/info_private_api.h" | 39 #include "chrome/browser/chromeos/extensions/info_private_api.h" |
62 #include "chrome/browser/chromeos/extensions/input_method_api.h" | 40 #include "chrome/browser/chromeos/extensions/input_method_api.h" |
63 #include "chrome/browser/chromeos/extensions/media_player_api.h" | 41 #include "chrome/browser/chromeos/extensions/media_player_api.h" |
64 #include "chrome/browser/chromeos/extensions/power/power_api.h" | 42 #include "chrome/browser/chromeos/extensions/power/power_api.h" |
65 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" | 43 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" |
66 #include "chrome/browser/extensions/api/terminal/terminal_private_api.h" | 44 #include "chrome/browser/extensions/api/terminal/terminal_private_api.h" |
67 #endif | 45 #endif // defined(OS_CHROMEOS) |
68 | 46 |
69 // static | 47 // static |
70 ExtensionFunctionRegistry* ExtensionFunctionRegistry::GetInstance() { | 48 ExtensionFunctionRegistry* ExtensionFunctionRegistry::GetInstance() { |
71 return Singleton<ExtensionFunctionRegistry>::get(); | 49 return Singleton<ExtensionFunctionRegistry>::get(); |
72 } | 50 } |
73 | 51 |
74 ExtensionFunctionRegistry::ExtensionFunctionRegistry() { | 52 ExtensionFunctionRegistry::ExtensionFunctionRegistry() { |
75 ResetFunctions(); | 53 ResetFunctions(); |
76 } | 54 } |
77 | 55 |
78 ExtensionFunctionRegistry::~ExtensionFunctionRegistry() { | 56 ExtensionFunctionRegistry::~ExtensionFunctionRegistry() { |
79 } | 57 } |
80 | 58 |
81 void ExtensionFunctionRegistry::ResetFunctions() { | 59 void ExtensionFunctionRegistry::ResetFunctions() { |
82 #if defined(ENABLE_EXTENSIONS) | 60 #if defined(ENABLE_EXTENSIONS) |
83 | 61 |
84 // Register all functions here. | 62 // Register all functions here. |
85 | 63 |
86 // Windows | |
87 RegisterFunction<GetWindowFunction>(); | |
88 RegisterFunction<GetCurrentWindowFunction>(); | |
89 RegisterFunction<GetLastFocusedWindowFunction>(); | |
90 RegisterFunction<GetAllWindowsFunction>(); | |
91 RegisterFunction<CreateWindowFunction>(); | |
92 RegisterFunction<UpdateWindowFunction>(); | |
93 RegisterFunction<RemoveWindowFunction>(); | |
94 | |
95 // Tabs | |
96 RegisterFunction<CaptureVisibleTabFunction>(); | |
97 RegisterFunction<CreateTabFunction>(); | |
98 RegisterFunction<DetectTabLanguageFunction>(); | |
99 RegisterFunction<DuplicateTabFunction>(); | |
100 RegisterFunction<GetAllTabsInWindowFunction>(); | |
101 RegisterFunction<GetCurrentTabFunction>(); | |
102 RegisterFunction<GetSelectedTabFunction>(); | |
103 RegisterFunction<GetTabFunction>(); | |
104 RegisterFunction<HighlightTabsFunction>(); | |
105 RegisterFunction<MoveTabsFunction>(); | |
106 RegisterFunction<QueryTabsFunction>(); | |
107 RegisterFunction<ReloadTabFunction>(); | |
108 RegisterFunction<RemoveTabsFunction>(); | |
109 RegisterFunction<TabsExecuteScriptFunction>(); | |
110 RegisterFunction<TabsInsertCSSFunction>(); | |
111 RegisterFunction<UpdateTabFunction>(); | |
112 | |
113 // Page Actions. | 64 // Page Actions. |
114 RegisterFunction<EnablePageActionsFunction>(); | 65 RegisterFunction<EnablePageActionsFunction>(); |
115 RegisterFunction<DisablePageActionsFunction>(); | 66 RegisterFunction<DisablePageActionsFunction>(); |
116 RegisterFunction<PageActionShowFunction>(); | 67 RegisterFunction<PageActionShowFunction>(); |
117 RegisterFunction<PageActionHideFunction>(); | 68 RegisterFunction<PageActionHideFunction>(); |
118 RegisterFunction<PageActionSetIconFunction>(); | 69 RegisterFunction<PageActionSetIconFunction>(); |
119 RegisterFunction<PageActionSetTitleFunction>(); | 70 RegisterFunction<PageActionSetTitleFunction>(); |
120 RegisterFunction<PageActionSetPopupFunction>(); | 71 RegisterFunction<PageActionSetPopupFunction>(); |
121 RegisterFunction<PageActionGetTitleFunction>(); | 72 RegisterFunction<PageActionGetTitleFunction>(); |
122 RegisterFunction<PageActionGetPopupFunction>(); | 73 RegisterFunction<PageActionGetPopupFunction>(); |
(...skipping 24 matching lines...) Expand all Loading... |
147 RegisterFunction<RemoveDownloadsFunction>(); | 98 RegisterFunction<RemoveDownloadsFunction>(); |
148 RegisterFunction<RemoveFileSystemsFunction>(); | 99 RegisterFunction<RemoveFileSystemsFunction>(); |
149 RegisterFunction<RemoveFormDataFunction>(); | 100 RegisterFunction<RemoveFormDataFunction>(); |
150 RegisterFunction<RemoveHistoryFunction>(); | 101 RegisterFunction<RemoveHistoryFunction>(); |
151 RegisterFunction<RemoveIndexedDBFunction>(); | 102 RegisterFunction<RemoveIndexedDBFunction>(); |
152 RegisterFunction<RemoveLocalStorageFunction>(); | 103 RegisterFunction<RemoveLocalStorageFunction>(); |
153 RegisterFunction<RemovePluginDataFunction>(); | 104 RegisterFunction<RemovePluginDataFunction>(); |
154 RegisterFunction<RemovePasswordsFunction>(); | 105 RegisterFunction<RemovePasswordsFunction>(); |
155 RegisterFunction<RemoveWebSQLFunction>(); | 106 RegisterFunction<RemoveWebSQLFunction>(); |
156 | 107 |
157 // Bookmarks. | |
158 RegisterFunction<extensions::GetBookmarksFunction>(); | |
159 RegisterFunction<extensions::GetBookmarkChildrenFunction>(); | |
160 RegisterFunction<extensions::GetBookmarkRecentFunction>(); | |
161 RegisterFunction<extensions::GetBookmarkTreeFunction>(); | |
162 RegisterFunction<extensions::GetBookmarkSubTreeFunction>(); | |
163 RegisterFunction<extensions::ImportBookmarksFunction>(); | |
164 RegisterFunction<extensions::ExportBookmarksFunction>(); | |
165 RegisterFunction<extensions::SearchBookmarksFunction>(); | |
166 RegisterFunction<extensions::RemoveBookmarkFunction>(); | |
167 RegisterFunction<extensions::RemoveTreeBookmarkFunction>(); | |
168 RegisterFunction<extensions::CreateBookmarkFunction>(); | |
169 RegisterFunction<extensions::MoveBookmarkFunction>(); | |
170 RegisterFunction<extensions::UpdateBookmarkFunction>(); | |
171 | |
172 // Infobars. | 108 // Infobars. |
173 RegisterFunction<ShowInfoBarFunction>(); | 109 RegisterFunction<ShowInfoBarFunction>(); |
174 | 110 |
175 // BookmarkManager | 111 // BookmarkManager |
176 RegisterFunction<extensions::CopyBookmarkManagerFunction>(); | 112 RegisterFunction<extensions::CopyBookmarkManagerFunction>(); |
177 RegisterFunction<extensions::CutBookmarkManagerFunction>(); | 113 RegisterFunction<extensions::CutBookmarkManagerFunction>(); |
178 RegisterFunction<extensions::PasteBookmarkManagerFunction>(); | 114 RegisterFunction<extensions::PasteBookmarkManagerFunction>(); |
179 RegisterFunction<extensions::CanPasteBookmarkManagerFunction>(); | 115 RegisterFunction<extensions::CanPasteBookmarkManagerFunction>(); |
180 RegisterFunction<extensions::SortChildrenBookmarkManagerFunction>(); | 116 RegisterFunction<extensions::SortChildrenBookmarkManagerFunction>(); |
181 RegisterFunction<extensions::BookmarkManagerGetStringsFunction>(); | 117 RegisterFunction<extensions::BookmarkManagerGetStringsFunction>(); |
182 RegisterFunction<extensions::StartDragBookmarkManagerFunction>(); | 118 RegisterFunction<extensions::StartDragBookmarkManagerFunction>(); |
183 RegisterFunction<extensions::DropBookmarkManagerFunction>(); | 119 RegisterFunction<extensions::DropBookmarkManagerFunction>(); |
184 RegisterFunction<extensions::GetSubtreeBookmarkManagerFunction>(); | 120 RegisterFunction<extensions::GetSubtreeBookmarkManagerFunction>(); |
185 RegisterFunction<extensions::CanEditBookmarkManagerFunction>(); | 121 RegisterFunction<extensions::CanEditBookmarkManagerFunction>(); |
186 RegisterFunction<extensions::CanOpenNewWindowsBookmarkFunction>(); | 122 RegisterFunction<extensions::CanOpenNewWindowsBookmarkFunction>(); |
187 | 123 |
188 // History | |
189 RegisterFunction<extensions::AddUrlHistoryFunction>(); | |
190 RegisterFunction<extensions::DeleteAllHistoryFunction>(); | |
191 RegisterFunction<extensions::DeleteRangeHistoryFunction>(); | |
192 RegisterFunction<extensions::DeleteUrlHistoryFunction>(); | |
193 RegisterFunction<extensions::GetMostVisitedHistoryFunction>(); | |
194 RegisterFunction<extensions::GetVisitsHistoryFunction>(); | |
195 RegisterFunction<extensions::SearchHistoryFunction>(); | |
196 | |
197 // Idle | 124 // Idle |
198 RegisterFunction<extensions::IdleQueryStateFunction>(); | 125 RegisterFunction<extensions::IdleQueryStateFunction>(); |
199 RegisterFunction<extensions::IdleSetDetectionIntervalFunction>(); | 126 RegisterFunction<extensions::IdleSetDetectionIntervalFunction>(); |
200 | 127 |
201 // I18N. | |
202 RegisterFunction<GetAcceptLanguagesFunction>(); | |
203 | |
204 // Metrics. | 128 // Metrics. |
205 RegisterFunction<extensions::MetricsRecordUserActionFunction>(); | 129 RegisterFunction<extensions::MetricsRecordUserActionFunction>(); |
206 RegisterFunction<extensions::MetricsRecordValueFunction>(); | 130 RegisterFunction<extensions::MetricsRecordValueFunction>(); |
207 RegisterFunction<extensions::MetricsRecordPercentageFunction>(); | 131 RegisterFunction<extensions::MetricsRecordPercentageFunction>(); |
208 RegisterFunction<extensions::MetricsRecordCountFunction>(); | 132 RegisterFunction<extensions::MetricsRecordCountFunction>(); |
209 RegisterFunction<extensions::MetricsRecordSmallCountFunction>(); | 133 RegisterFunction<extensions::MetricsRecordSmallCountFunction>(); |
210 RegisterFunction<extensions::MetricsRecordMediumCountFunction>(); | 134 RegisterFunction<extensions::MetricsRecordMediumCountFunction>(); |
211 RegisterFunction<extensions::MetricsRecordTimeFunction>(); | 135 RegisterFunction<extensions::MetricsRecordTimeFunction>(); |
212 RegisterFunction<extensions::MetricsRecordMediumTimeFunction>(); | 136 RegisterFunction<extensions::MetricsRecordMediumTimeFunction>(); |
213 RegisterFunction<extensions::MetricsRecordLongTimeFunction>(); | 137 RegisterFunction<extensions::MetricsRecordLongTimeFunction>(); |
214 | 138 |
215 // RLZ (not supported on ChromeOS yet). | 139 // RLZ (not supported on ChromeOS yet). |
216 #if defined(ENABLE_RLZ) && !defined(OS_CHROMEOS) | 140 #if defined(ENABLE_RLZ) && !defined(OS_CHROMEOS) |
217 RegisterFunction<RlzRecordProductEventFunction>(); | 141 RegisterFunction<RlzRecordProductEventFunction>(); |
218 RegisterFunction<RlzGetAccessPointRlzFunction>(); | 142 RegisterFunction<RlzGetAccessPointRlzFunction>(); |
219 RegisterFunction<RlzSendFinancialPingFunction>(); | 143 RegisterFunction<RlzSendFinancialPingFunction>(); |
220 RegisterFunction<RlzClearProductStateFunction>(); | 144 RegisterFunction<RlzClearProductStateFunction>(); |
221 #endif | 145 #endif |
222 | 146 |
223 // Cookies. | |
224 RegisterFunction<extensions::GetCookieFunction>(); | |
225 RegisterFunction<extensions::GetAllCookiesFunction>(); | |
226 RegisterFunction<extensions::SetCookieFunction>(); | |
227 RegisterFunction<extensions::RemoveCookieFunction>(); | |
228 RegisterFunction<extensions::GetAllCookieStoresFunction>(); | |
229 | |
230 // Test. | 147 // Test. |
231 RegisterFunction<extensions::TestNotifyPassFunction>(); | 148 RegisterFunction<extensions::TestNotifyPassFunction>(); |
232 RegisterFunction<extensions::TestFailFunction>(); | 149 RegisterFunction<extensions::TestFailFunction>(); |
233 RegisterFunction<extensions::TestLogFunction>(); | 150 RegisterFunction<extensions::TestLogFunction>(); |
234 RegisterFunction<extensions::TestResetQuotaFunction>(); | 151 RegisterFunction<extensions::TestResetQuotaFunction>(); |
235 RegisterFunction<extensions::TestCreateIncognitoTabFunction>(); | 152 RegisterFunction<extensions::TestCreateIncognitoTabFunction>(); |
236 RegisterFunction<extensions::TestSendMessageFunction>(); | 153 RegisterFunction<extensions::TestSendMessageFunction>(); |
237 RegisterFunction<extensions::TestGetConfigFunction>(); | 154 RegisterFunction<extensions::TestGetConfigFunction>(); |
238 | 155 |
239 // Record. | |
240 RegisterFunction<extensions::CaptureURLsFunction>(); | |
241 RegisterFunction<extensions::ReplayURLsFunction>(); | |
242 | |
243 // Accessibility. | 156 // Accessibility. |
244 RegisterFunction<GetFocusedControlFunction>(); | 157 RegisterFunction<GetFocusedControlFunction>(); |
245 RegisterFunction<SetAccessibilityEnabledFunction>(); | 158 RegisterFunction<SetAccessibilityEnabledFunction>(); |
246 RegisterFunction<GetAlertsForTabFunction>(); | 159 RegisterFunction<GetAlertsForTabFunction>(); |
247 | 160 |
248 // Commands. | 161 // Commands. |
249 RegisterFunction<GetAllCommandsFunction>(); | 162 RegisterFunction<GetAllCommandsFunction>(); |
250 | 163 |
251 // Context Menus. | |
252 RegisterFunction<extensions::CreateContextMenuFunction>(); | |
253 RegisterFunction<extensions::UpdateContextMenuFunction>(); | |
254 RegisterFunction<extensions::RemoveContextMenuFunction>(); | |
255 RegisterFunction<extensions::RemoveAllContextMenusFunction>(); | |
256 | |
257 // Omnibox. | 164 // Omnibox. |
258 RegisterFunction<extensions::OmniboxSendSuggestionsFunction>(); | 165 RegisterFunction<extensions::OmniboxSendSuggestionsFunction>(); |
259 RegisterFunction<extensions::OmniboxSetDefaultSuggestionFunction>(); | 166 RegisterFunction<extensions::OmniboxSetDefaultSuggestionFunction>(); |
260 | 167 |
261 #if defined(ENABLE_INPUT_SPEECH) | 168 #if defined(ENABLE_INPUT_SPEECH) |
262 // Speech input. | 169 // Speech input. |
263 RegisterFunction<StartSpeechInputFunction>(); | 170 RegisterFunction<StartSpeechInputFunction>(); |
264 RegisterFunction<StopSpeechInputFunction>(); | 171 RegisterFunction<StopSpeechInputFunction>(); |
265 RegisterFunction<IsRecordingSpeechInputFunction>(); | 172 RegisterFunction<IsRecordingSpeechInputFunction>(); |
266 #endif | 173 #endif |
267 | 174 |
268 #if defined(TOOLKIT_VIEWS) | 175 #if defined(TOOLKIT_VIEWS) |
269 // Input. | 176 // Input. |
270 RegisterFunction<extensions::SendKeyboardEventInputFunction>(); | 177 RegisterFunction<extensions::SendKeyboardEventInputFunction>(); |
271 #endif | 178 #endif |
272 | 179 |
273 #if defined(OS_CHROMEOS) | 180 #if defined(OS_CHROMEOS) |
274 // Power | 181 // Power |
275 RegisterFunction<extensions::power::RequestKeepAwakeFunction>(); | 182 RegisterFunction<extensions::power::RequestKeepAwakeFunction>(); |
276 RegisterFunction<extensions::power::ReleaseKeepAwakeFunction>(); | 183 RegisterFunction<extensions::power::ReleaseKeepAwakeFunction>(); |
277 #endif | 184 #endif |
278 | 185 |
279 // Managed mode. | 186 // Managed mode. |
280 RegisterFunction<extensions::GetManagedModeFunction>(); | 187 RegisterFunction<extensions::GetManagedModeFunction>(); |
281 RegisterFunction<extensions::EnterManagedModeFunction>(); | 188 RegisterFunction<extensions::EnterManagedModeFunction>(); |
282 RegisterFunction<extensions::GetPolicyFunction>(); | 189 RegisterFunction<extensions::GetPolicyFunction>(); |
283 RegisterFunction<extensions::SetPolicyFunction>(); | 190 RegisterFunction<extensions::SetPolicyFunction>(); |
284 | 191 |
285 // Management. | |
286 RegisterFunction<extensions::GetAllExtensionsFunction>(); | |
287 RegisterFunction<extensions::GetExtensionByIdFunction>(); | |
288 RegisterFunction<extensions::GetPermissionWarningsByIdFunction>(); | |
289 RegisterFunction<extensions::GetPermissionWarningsByManifestFunction>(); | |
290 RegisterFunction<extensions::LaunchAppFunction>(); | |
291 RegisterFunction<extensions::SetEnabledFunction>(); | |
292 RegisterFunction<extensions::UninstallFunction>(); | |
293 | |
294 // Extension module. | 192 // Extension module. |
295 RegisterFunction<extensions::SetUpdateUrlDataFunction>(); | 193 RegisterFunction<extensions::SetUpdateUrlDataFunction>(); |
296 RegisterFunction<extensions::IsAllowedIncognitoAccessFunction>(); | 194 RegisterFunction<extensions::IsAllowedIncognitoAccessFunction>(); |
297 RegisterFunction<extensions::IsAllowedFileSchemeAccessFunction>(); | 195 RegisterFunction<extensions::IsAllowedFileSchemeAccessFunction>(); |
298 | 196 |
299 // WebstorePrivate. | 197 // WebstorePrivate. |
300 RegisterFunction<extensions::GetBrowserLoginFunction>(); | 198 RegisterFunction<extensions::GetBrowserLoginFunction>(); |
301 RegisterFunction<extensions::GetStoreLoginFunction>(); | 199 RegisterFunction<extensions::GetStoreLoginFunction>(); |
302 RegisterFunction<extensions::SetStoreLoginFunction>(); | 200 RegisterFunction<extensions::SetStoreLoginFunction>(); |
303 RegisterFunction<extensions::InstallBundleFunction>(); | 201 RegisterFunction<extensions::InstallBundleFunction>(); |
304 RegisterFunction<extensions::BeginInstallWithManifestFunction>(); | 202 RegisterFunction<extensions::BeginInstallWithManifestFunction>(); |
305 RegisterFunction<extensions::CompleteInstallFunction>(); | 203 RegisterFunction<extensions::CompleteInstallFunction>(); |
306 RegisterFunction<extensions::GetWebGLStatusFunction>(); | 204 RegisterFunction<extensions::GetWebGLStatusFunction>(); |
307 | 205 |
308 // WebNavigation. | |
309 RegisterFunction<extensions::GetFrameFunction>(); | |
310 RegisterFunction<extensions::GetAllFramesFunction>(); | |
311 | |
312 // WebRequest. | 206 // WebRequest. |
313 RegisterFunction<WebRequestAddEventListener>(); | 207 RegisterFunction<WebRequestAddEventListener>(); |
314 RegisterFunction<WebRequestEventHandled>(); | 208 RegisterFunction<WebRequestEventHandled>(); |
315 RegisterFunction<WebRequestHandlerBehaviorChanged>(); | |
316 | 209 |
317 // Preferences. | 210 // Preferences. |
318 RegisterFunction<extensions::GetPreferenceFunction>(); | 211 RegisterFunction<extensions::GetPreferenceFunction>(); |
319 RegisterFunction<extensions::SetPreferenceFunction>(); | 212 RegisterFunction<extensions::SetPreferenceFunction>(); |
320 RegisterFunction<extensions::ClearPreferenceFunction>(); | 213 RegisterFunction<extensions::ClearPreferenceFunction>(); |
321 | 214 |
322 // ChromeOS-specific part of the API. | 215 // ChromeOS-specific part of the API. |
323 #if defined(OS_CHROMEOS) | 216 #if defined(OS_CHROMEOS) |
324 // Device Customization. | 217 // Device Customization. |
325 RegisterFunction<extensions::GetChromeosInfoFunction>(); | 218 RegisterFunction<extensions::GetChromeosInfoFunction>(); |
326 | 219 |
327 // FileBrowserHandlerInternal. | |
328 RegisterFunction<FileHandlerSelectFileFunction>(); | |
329 | |
330 // Mediaplayer | 220 // Mediaplayer |
331 RegisterFunction<extensions::PlayMediaplayerFunction>(); | 221 RegisterFunction<extensions::PlayMediaplayerFunction>(); |
332 RegisterFunction<extensions::GetPlaylistMediaplayerFunction>(); | 222 RegisterFunction<extensions::GetPlaylistMediaplayerFunction>(); |
333 RegisterFunction<extensions::SetWindowHeightMediaplayerFunction>(); | 223 RegisterFunction<extensions::SetWindowHeightMediaplayerFunction>(); |
334 RegisterFunction<extensions::CloseWindowMediaplayerFunction>(); | 224 RegisterFunction<extensions::CloseWindowMediaplayerFunction>(); |
335 | 225 |
336 // WallpaperManagerPrivate functions. | 226 // WallpaperManagerPrivate functions. |
337 RegisterFunction<WallpaperStringsFunction>(); | 227 RegisterFunction<WallpaperStringsFunction>(); |
338 RegisterFunction<WallpaperSetWallpaperIfExistFunction>(); | 228 RegisterFunction<WallpaperSetWallpaperIfExistFunction>(); |
339 RegisterFunction<WallpaperSetWallpaperFunction>(); | 229 RegisterFunction<WallpaperSetWallpaperFunction>(); |
(...skipping 15 matching lines...) Expand all Loading... |
355 RegisterFunction<SendInputToTerminalProcessFunction>(); | 245 RegisterFunction<SendInputToTerminalProcessFunction>(); |
356 RegisterFunction<CloseTerminalProcessFunction>(); | 246 RegisterFunction<CloseTerminalProcessFunction>(); |
357 RegisterFunction<OnTerminalResizeFunction>(); | 247 RegisterFunction<OnTerminalResizeFunction>(); |
358 #endif | 248 #endif |
359 | 249 |
360 // Websocket to TCP proxy. Currently noop on anything other than ChromeOS. | 250 // Websocket to TCP proxy. Currently noop on anything other than ChromeOS. |
361 RegisterFunction< | 251 RegisterFunction< |
362 extensions::WebSocketProxyPrivateGetPassportForTCPFunction>(); | 252 extensions::WebSocketProxyPrivateGetPassportForTCPFunction>(); |
363 RegisterFunction<extensions::WebSocketProxyPrivateGetURLForTCPFunction>(); | 253 RegisterFunction<extensions::WebSocketProxyPrivateGetURLForTCPFunction>(); |
364 | 254 |
365 // Debugger | |
366 RegisterFunction<AttachDebuggerFunction>(); | |
367 RegisterFunction<DetachDebuggerFunction>(); | |
368 RegisterFunction<SendCommandDebuggerFunction>(); | |
369 | |
370 // Settings | |
371 RegisterFunction<extensions::GetSettingsFunction>(); | |
372 RegisterFunction<extensions::SetSettingsFunction>(); | |
373 RegisterFunction<extensions::RemoveSettingsFunction>(); | |
374 RegisterFunction<extensions::ClearSettingsFunction>(); | |
375 RegisterFunction<extensions::GetBytesInUseSettingsFunction>(); | |
376 | |
377 // Content settings. | |
378 RegisterFunction<extensions::GetResourceIdentifiersFunction>(); | |
379 RegisterFunction<extensions::ClearContentSettingsFunction>(); | |
380 RegisterFunction<extensions::GetContentSettingFunction>(); | |
381 RegisterFunction<extensions::SetContentSettingFunction>(); | |
382 | |
383 // Font settings. | |
384 RegisterFunction<extensions::GetFontListFunction>(); | |
385 RegisterFunction<extensions::ClearFontFunction>(); | |
386 RegisterFunction<extensions::GetFontFunction>(); | |
387 RegisterFunction<extensions::SetFontFunction>(); | |
388 RegisterFunction<extensions::ClearDefaultFontSizeFunction>(); | |
389 RegisterFunction<extensions::GetDefaultFontSizeFunction>(); | |
390 RegisterFunction<extensions::SetDefaultFontSizeFunction>(); | |
391 RegisterFunction<extensions::ClearDefaultFixedFontSizeFunction>(); | |
392 RegisterFunction<extensions::GetDefaultFixedFontSizeFunction>(); | |
393 RegisterFunction<extensions::SetDefaultFixedFontSizeFunction>(); | |
394 RegisterFunction<extensions::ClearMinimumFontSizeFunction>(); | |
395 RegisterFunction<extensions::GetMinimumFontSizeFunction>(); | |
396 RegisterFunction<extensions::SetMinimumFontSizeFunction>(); | |
397 | |
398 // CloudPrint settings. | |
399 RegisterFunction<extensions::CloudPrintSetupConnectorFunction>(); | |
400 RegisterFunction<extensions::CloudPrintGetHostNameFunction>(); | |
401 RegisterFunction<extensions::CloudPrintGetPrintersFunction>(); | |
402 | |
403 // Experimental App API. | 255 // Experimental App API. |
404 RegisterFunction<extensions::AppNotifyFunction>(); | 256 RegisterFunction<extensions::AppNotifyFunction>(); |
405 RegisterFunction<extensions::AppClearAllNotificationsFunction>(); | 257 RegisterFunction<extensions::AppClearAllNotificationsFunction>(); |
406 | 258 |
407 // Permissions | |
408 RegisterFunction<ContainsPermissionsFunction>(); | |
409 RegisterFunction<GetAllPermissionsFunction>(); | |
410 RegisterFunction<RemovePermissionsFunction>(); | |
411 RegisterFunction<RequestPermissionsFunction>(); | |
412 | |
413 // PageCapture | |
414 RegisterFunction<extensions::PageCaptureSaveAsMHTMLFunction>(); | |
415 | |
416 // TopSites | 259 // TopSites |
417 RegisterFunction<extensions::GetTopSitesFunction>(); | 260 RegisterFunction<extensions::GetTopSitesFunction>(); |
418 | 261 |
419 // Serial | |
420 RegisterFunction<extensions::SerialOpenFunction>(); | |
421 RegisterFunction<extensions::SerialCloseFunction>(); | |
422 RegisterFunction<extensions::SerialReadFunction>(); | |
423 RegisterFunction<extensions::SerialWriteFunction>(); | |
424 | |
425 // Sockets | |
426 RegisterFunction<extensions::SocketCreateFunction>(); | |
427 RegisterFunction<extensions::SocketDestroyFunction>(); | |
428 RegisterFunction<extensions::SocketConnectFunction>(); | |
429 RegisterFunction<extensions::SocketDisconnectFunction>(); | |
430 RegisterFunction<extensions::SocketReadFunction>(); | |
431 RegisterFunction<extensions::SocketWriteFunction>(); | |
432 | |
433 // System | 262 // System |
434 RegisterFunction<extensions::GetIncognitoModeAvailabilityFunction>(); | 263 RegisterFunction<extensions::GetIncognitoModeAvailabilityFunction>(); |
435 RegisterFunction<extensions::GetUpdateStatusFunction>(); | 264 RegisterFunction<extensions::GetUpdateStatusFunction>(); |
436 | 265 |
437 // Net | |
438 RegisterFunction<extensions::AddRulesFunction>(); | |
439 RegisterFunction<extensions::RemoveRulesFunction>(); | |
440 RegisterFunction<extensions::GetRulesFunction>(); | |
441 | |
442 // Runtime | 266 // Runtime |
443 RegisterFunction<extensions::RuntimeGetBackgroundPageFunction>(); | 267 RegisterFunction<extensions::RuntimeGetBackgroundPageFunction>(); |
444 RegisterFunction<extensions::RuntimeReloadFunction>(); | 268 RegisterFunction<extensions::RuntimeReloadFunction>(); |
445 RegisterFunction<extensions::RuntimeRequestUpdateCheckFunction>(); | 269 RegisterFunction<extensions::RuntimeRequestUpdateCheckFunction>(); |
446 | 270 |
447 // Generated APIs | 271 // Generated APIs |
448 extensions::api::GeneratedFunctionRegistry::RegisterAll(this); | 272 extensions::api::GeneratedFunctionRegistry::RegisterAll(this); |
449 #endif // defined(ENABLE_EXTENSIONS) | 273 #endif // defined(ENABLE_EXTENSIONS) |
450 } | 274 } |
451 | 275 |
(...skipping 17 matching lines...) Expand all Loading... |
469 } | 293 } |
470 | 294 |
471 ExtensionFunction* ExtensionFunctionRegistry::NewFunction( | 295 ExtensionFunction* ExtensionFunctionRegistry::NewFunction( |
472 const std::string& name) { | 296 const std::string& name) { |
473 FactoryMap::iterator iter = factories_.find(name); | 297 FactoryMap::iterator iter = factories_.find(name); |
474 DCHECK(iter != factories_.end()); | 298 DCHECK(iter != factories_.end()); |
475 ExtensionFunction* function = iter->second(); | 299 ExtensionFunction* function = iter->second(); |
476 function->set_name(name); | 300 function->set_name(name); |
477 return function; | 301 return function; |
478 } | 302 } |
OLD | NEW |