blob: 614c23cf1691dbcdda92a113259178c8c315c64e [file] [log] [blame]
[email protected]e0813a392011-02-01 22:57:251// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]bfdffe2b2009-04-24 22:05:352// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/extensions/extension_function_dispatcher.h"
6
[email protected]745feedb2010-08-02 04:08:077#include <map>
8
[email protected]3b63f8f42011-03-28 01:54:159#include "base/memory/ref_counted.h"
10#include "base/memory/singleton.h"
[email protected]bfdffe2b2009-04-24 22:05:3511#include "base/process_util.h"
[email protected]bfdffe2b2009-04-24 22:05:3512#include "base/values.h"
[email protected]17d40f02010-07-01 01:18:0613#include "build/build_config.h"
[email protected]a692a952011-11-28 08:23:5414#include "chrome/browser/accessibility/accessibility_extension_api.h"
[email protected]23d5f172011-10-25 05:49:5315#include "chrome/browser/bookmarks/bookmark_extension_api.h"
16#include "chrome/browser/bookmarks/bookmark_manager_extension_api.h"
[email protected]cdcf60242011-11-04 15:53:4317#include "chrome/browser/download/download_extension_api.h"
[email protected]55afeb52011-12-06 00:15:3918#include "chrome/browser/extensions/api/socket/socket_api.h"
[email protected]912256b32009-09-18 09:47:3519#include "chrome/browser/extensions/execute_code_in_tab_function.h"
[email protected]c1d05aa2011-06-28 02:07:3020#include "chrome/browser/extensions/extension_app_api.h"
[email protected]ec9ac0df2009-10-01 18:06:4721#include "chrome/browser/extensions/extension_browser_actions_api.h"
[email protected]cdcf60242011-11-04 15:53:4322#include "chrome/browser/extensions/extension_chrome_auth_private_api.h"
[email protected]6093d742011-08-26 16:37:1823#include "chrome/browser/extensions/extension_clear_api.h"
[email protected]fa0624262011-06-09 14:17:3824#include "chrome/browser/extensions/extension_content_settings_api.h"
[email protected]2e3b5202010-03-23 06:52:4125#include "chrome/browser/extensions/extension_context_menu_api.h"
[email protected]898bbd32010-05-18 18:52:2926#include "chrome/browser/extensions/extension_cookies_api.h"
[email protected]91ba3312011-03-17 20:39:2227#include "chrome/browser/extensions/extension_debugger_api.h"
[email protected]bfdffe2b2009-04-24 22:05:3528#include "chrome/browser/extensions/extension_function.h"
[email protected]2bb51302011-02-18 22:39:2729#include "chrome/browser/extensions/extension_i18n_api.h"
[email protected]2f69b382011-02-19 00:34:2530#include "chrome/browser/extensions/extension_idle_api.h"
[email protected]cffd7892010-08-26 17:43:2831#include "chrome/browser/extensions/extension_management_api.h"
[email protected]438772df2010-02-26 18:08:4332#include "chrome/browser/extensions/extension_metrics_module.h"
[email protected]a65882c2010-11-12 15:15:0933#include "chrome/browser/extensions/extension_module.h"
[email protected]56ad3792010-05-28 17:45:3334#include "chrome/browser/extensions/extension_omnibox_api.h"
[email protected]f7f3a5f2009-05-01 22:02:3435#include "chrome/browser/extensions/extension_page_actions_module.h"
[email protected]9e4430f2011-11-28 07:43:2936#include "chrome/browser/extensions/extension_page_capture_api.h"
[email protected]902fd7b2011-07-27 18:42:3137#include "chrome/browser/extensions/extension_permissions_api.h"
[email protected]598bbcc2011-02-24 10:03:2538#include "chrome/browser/extensions/extension_preference_api.h"
[email protected]381162b2010-01-28 17:29:3539#include "chrome/browser/extensions/extension_processes_api.h"
[email protected]a9c23a52010-08-04 09:13:4440#include "chrome/browser/extensions/extension_proxy_api.h"
[email protected]2f69b382011-02-19 00:34:2541#include "chrome/browser/extensions/extension_service.h"
[email protected]8b8e7c92010-08-19 18:05:5642#include "chrome/browser/extensions/extension_sidebar_api.h"
[email protected]bfdffe2b2009-04-24 22:05:3543#include "chrome/browser/extensions/extension_tabs_module.h"
[email protected]25fd1b2e2009-08-17 20:57:1444#include "chrome/browser/extensions/extension_test_api.h"
[email protected]8abe0a32010-08-12 00:40:2245#include "chrome/browser/extensions/extension_tts_api.h"
[email protected]c63f2b72011-07-07 05:25:0046#include "chrome/browser/extensions/extension_tts_engine_api.h"
[email protected]c6e584c2011-05-18 11:58:4447#include "chrome/browser/extensions/extension_web_socket_proxy_private_api.h"
[email protected]8f9d4eb2011-02-05 01:39:1048#include "chrome/browser/extensions/extension_web_ui.h"
[email protected]557a51dd2011-07-26 12:17:1149#include "chrome/browser/extensions/extension_webnavigation_api.h"
[email protected]c41fe662011-02-15 01:19:2650#include "chrome/browser/extensions/extension_webrequest_api.h"
[email protected]63cda0c2010-09-01 04:41:2351#include "chrome/browser/extensions/extension_webstore_private_api.h"
[email protected]d13950e2009-12-04 01:43:0252#include "chrome/browser/extensions/extensions_quota_service.h"
[email protected]a4f98922011-12-06 11:32:2353#include "chrome/browser/extensions/system/system_api.h"
[email protected]83820d42011-11-12 22:03:1154#include "chrome/browser/extensions/process_map.h"
[email protected]ae7f1ba2011-11-28 23:07:3155#include "chrome/browser/extensions/settings/settings_api.h"
[email protected]ed2b1002011-05-25 14:12:1056#include "chrome/browser/external_protocol/external_protocol_handler.h"
[email protected]d2e6bd62011-10-24 20:29:0757#include "chrome/browser/history/history_extension_api.h"
[email protected]5eddc3e2011-10-26 04:33:3158#include "chrome/browser/history/top_sites_extension_api.h"
[email protected]cdcf60242011-11-04 15:53:4359#include "chrome/browser/infobars/infobar_extension_api.h"
[email protected]8ecad5e2010-12-02 21:18:3360#include "chrome/browser/profiles/profile.h"
[email protected]c357acb42011-06-09 20:52:4261#include "chrome/browser/renderer_host/chrome_render_message_filter.h"
[email protected]792556c2011-10-25 05:01:0762#include "chrome/browser/rlz/rlz_extension_api.h"
[email protected]b9971dc2011-11-11 15:50:4363#include "chrome/browser/speech/speech_input_extension_api.h"
[email protected]71b73f02011-04-06 15:57:2964#include "chrome/browser/ui/browser_list.h"
[email protected]00070c732011-04-09 15:31:3365#include "chrome/browser/ui/browser_window.h"
[email protected]83820d42011-11-12 22:03:1166#include "chrome/common/extensions/api/extension_api.h"
[email protected]44c49c92011-03-28 16:17:2367#include "chrome/common/extensions/extension_messages.h"
[email protected]615d88f2011-12-13 01:47:4468#include "chrome/common/extensions/extension_set.h"
[email protected]9c45b7182009-08-04 16:44:4369#include "chrome/common/url_constants.h"
[email protected]5de634712011-03-02 00:20:1970#include "content/browser/renderer_host/render_view_host.h"
[email protected]f82d57b52011-04-27 19:13:1771#include "ipc/ipc_message.h"
72#include "ipc/ipc_message_macros.h"
[email protected]939856a2010-08-24 20:29:0273#include "third_party/skia/include/core/SkBitmap.h"
[email protected]615d88f2011-12-13 01:47:4474#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
[email protected]bfdffe2b2009-04-24 22:05:3575
[email protected]8f9d4eb2011-02-05 01:39:1076#if defined(TOOLKIT_VIEWS)
77#include "chrome/browser/extensions/extension_input_api.h"
78#endif
[email protected]d6833852010-08-20 18:00:4579
[email protected]9a2aebe02011-12-02 21:54:1480#if defined(OS_CHROMEOS) && defined(USE_VIRTUAL_KEYBOARD)
[email protected]27072cad2011-05-09 19:46:4081#include "chrome/browser/extensions/extension_input_ui_api.h"
82#endif
83
[email protected]61b55b62011-03-24 09:03:1084#if defined(OS_CHROMEOS)
[email protected]8f427982011-12-13 23:40:2385#include "chrome/browser/extensions/api/terminal/terminal_private_api.h"
[email protected]8baf0dbb2011-11-27 22:47:0286#include "chrome/browser/extensions/extension_file_browser_private_api.h"
87#include "chrome/browser/extensions/extension_info_private_api_chromeos.h"
88#include "chrome/browser/extensions/extension_input_ime_api.h"
89#include "chrome/browser/extensions/extension_input_method_api.h"
90#include "chrome/browser/extensions/extension_mediaplayer_private_api.h"
[email protected]61b55b62011-03-24 09:03:1091#endif
92
[email protected]83820d42011-11-12 22:03:1193using extensions::ExtensionAPI;
[email protected]615d88f2011-12-13 01:47:4494using WebKit::WebSecurityOrigin;
[email protected]83820d42011-11-12 22:03:1195
[email protected]bfdffe2b2009-04-24 22:05:3596// FactoryRegistry -------------------------------------------------------------
97
98namespace {
99
[email protected]b83e4602009-05-15 22:58:33100// Template for defining ExtensionFunctionFactory.
101template<class T>
102ExtensionFunction* NewExtensionFunction() {
103 return new T();
104}
[email protected]bfdffe2b2009-04-24 22:05:35105
[email protected]b83e4602009-05-15 22:58:33106// Contains a list of all known extension functions and allows clients to
107// create instances of them.
[email protected]bfdffe2b2009-04-24 22:05:35108class FactoryRegistry {
109 public:
[email protected]8e8bb6d2010-12-13 08:18:55110 static FactoryRegistry* GetInstance();
[email protected]b83e4602009-05-15 22:58:33111 FactoryRegistry() { ResetFunctions(); }
112
113 // Resets all functions to their default values.
114 void ResetFunctions();
115
116 // Adds all function names to 'names'.
[email protected]bfdffe2b2009-04-24 22:05:35117 void GetAllNames(std::vector<std::string>* names);
[email protected]b83e4602009-05-15 22:58:33118
119 // Allows overriding of specific functions (e.g. for testing). Functions
120 // must be previously registered. Returns true if successful.
121 bool OverrideFunction(const std::string& name,
122 ExtensionFunctionFactory factory);
123
124 // Factory method for the ExtensionFunction registered as 'name'.
[email protected]bfdffe2b2009-04-24 22:05:35125 ExtensionFunction* NewFunction(const std::string& name);
126
127 private:
[email protected]61424c062009-10-14 23:14:59128 template<class T>
129 void RegisterFunction() {
130 factories_[T::function_name()] = &NewExtensionFunction<T>;
131 }
132
[email protected]bfdffe2b2009-04-24 22:05:35133 typedef std::map<std::string, ExtensionFunctionFactory> FactoryMap;
134 FactoryMap factories_;
135};
136
[email protected]8e8bb6d2010-12-13 08:18:55137FactoryRegistry* FactoryRegistry::GetInstance() {
[email protected]bfdffe2b2009-04-24 22:05:35138 return Singleton<FactoryRegistry>::get();
139}
140
[email protected]b83e4602009-05-15 22:58:33141void FactoryRegistry::ResetFunctions() {
[email protected]bfdffe2b2009-04-24 22:05:35142 // Register all functions here.
143
[email protected]e515f5d2009-05-05 03:05:00144 // Windows
[email protected]61424c062009-10-14 23:14:59145 RegisterFunction<GetWindowFunction>();
146 RegisterFunction<GetCurrentWindowFunction>();
147 RegisterFunction<GetLastFocusedWindowFunction>();
148 RegisterFunction<GetAllWindowsFunction>();
149 RegisterFunction<CreateWindowFunction>();
150 RegisterFunction<UpdateWindowFunction>();
151 RegisterFunction<RemoveWindowFunction>();
[email protected]b83e4602009-05-15 22:58:33152
[email protected]e515f5d2009-05-05 03:05:00153 // Tabs
[email protected]61424c062009-10-14 23:14:59154 RegisterFunction<GetTabFunction>();
[email protected]e3eafb292010-04-14 21:30:41155 RegisterFunction<GetCurrentTabFunction>();
[email protected]61424c062009-10-14 23:14:59156 RegisterFunction<GetSelectedTabFunction>();
157 RegisterFunction<GetAllTabsInWindowFunction>();
[email protected]8c3495c2011-09-28 03:32:30158 RegisterFunction<QueryTabsFunction>();
159 RegisterFunction<HighlightTabsFunction>();
[email protected]61424c062009-10-14 23:14:59160 RegisterFunction<CreateTabFunction>();
161 RegisterFunction<UpdateTabFunction>();
[email protected]8c3495c2011-09-28 03:32:30162 RegisterFunction<MoveTabsFunction>();
[email protected]5d935112011-09-07 09:24:54163 RegisterFunction<ReloadTabFunction>();
[email protected]8c3495c2011-09-28 03:32:30164 RegisterFunction<RemoveTabsFunction>();
[email protected]61424c062009-10-14 23:14:59165 RegisterFunction<DetectTabLanguageFunction>();
166 RegisterFunction<CaptureVisibleTabFunction>();
167 RegisterFunction<TabsExecuteScriptFunction>();
168 RegisterFunction<TabsInsertCSSFunction>();
[email protected]bfdffe2b2009-04-24 22:05:35169
[email protected]f7f3a5f2009-05-01 22:02:34170 // Page Actions.
[email protected]61424c062009-10-14 23:14:59171 RegisterFunction<EnablePageActionFunction>();
172 RegisterFunction<DisablePageActionFunction>();
[email protected]744ef172009-10-16 21:53:46173 RegisterFunction<PageActionShowFunction>();
174 RegisterFunction<PageActionHideFunction>();
175 RegisterFunction<PageActionSetIconFunction>();
176 RegisterFunction<PageActionSetTitleFunction>();
[email protected]e478d6702010-01-28 00:10:29177 RegisterFunction<PageActionSetPopupFunction>();
[email protected]f7f3a5f2009-05-01 22:02:34178
[email protected]ec9ac0df2009-10-01 18:06:47179 // Browser Actions.
[email protected]61424c062009-10-14 23:14:59180 RegisterFunction<BrowserActionSetIconFunction>();
[email protected]1288ba02009-10-15 00:02:24181 RegisterFunction<BrowserActionSetTitleFunction>();
[email protected]61424c062009-10-14 23:14:59182 RegisterFunction<BrowserActionSetBadgeTextFunction>();
183 RegisterFunction<BrowserActionSetBadgeBackgroundColorFunction>();
[email protected]85ae9592010-02-03 20:58:50184 RegisterFunction<BrowserActionSetPopupFunction>();
[email protected]ec9ac0df2009-10-01 18:06:47185
[email protected]6093d742011-08-26 16:37:18186 // Browsing Data.
187 RegisterFunction<ClearBrowsingDataFunction>();
188 RegisterFunction<ClearCacheFunction>();
189 RegisterFunction<ClearCookiesFunction>();
190 RegisterFunction<ClearDownloadsFunction>();
191 RegisterFunction<ClearFormDataFunction>();
192 RegisterFunction<ClearHistoryFunction>();
193 RegisterFunction<ClearPasswordsFunction>();
194
[email protected]f7f3a5f2009-05-01 22:02:34195 // Bookmarks.
[email protected]61424c062009-10-14 23:14:59196 RegisterFunction<GetBookmarksFunction>();
197 RegisterFunction<GetBookmarkChildrenFunction>();
[email protected]a3c94c712009-12-18 19:23:55198 RegisterFunction<GetBookmarkRecentFunction>();
[email protected]61424c062009-10-14 23:14:59199 RegisterFunction<GetBookmarkTreeFunction>();
[email protected]532a8c62011-06-03 21:30:01200 RegisterFunction<GetBookmarkSubTreeFunction>();
[email protected]61424c062009-10-14 23:14:59201 RegisterFunction<SearchBookmarksFunction>();
202 RegisterFunction<RemoveBookmarkFunction>();
203 RegisterFunction<RemoveTreeBookmarkFunction>();
204 RegisterFunction<CreateBookmarkFunction>();
205 RegisterFunction<MoveBookmarkFunction>();
206 RegisterFunction<UpdateBookmarkFunction>();
[email protected]9c45b7182009-08-04 16:44:43207
[email protected]f34e79632010-03-17 02:34:08208 // Infobars.
209 RegisterFunction<ShowInfoBarFunction>();
210
[email protected]9dd97bc2010-01-14 01:40:04211 // BookmarkManager
212 RegisterFunction<CopyBookmarkManagerFunction>();
213 RegisterFunction<CutBookmarkManagerFunction>();
214 RegisterFunction<PasteBookmarkManagerFunction>();
[email protected]03b3bbf2010-01-29 23:54:57215 RegisterFunction<CanPasteBookmarkManagerFunction>();
[email protected]cb6cf792010-01-28 00:04:56216 RegisterFunction<ImportBookmarksFunction>();
217 RegisterFunction<ExportBookmarksFunction>();
[email protected]d406e2e2010-01-30 21:45:18218 RegisterFunction<SortChildrenBookmarkManagerFunction>();
[email protected]9dd97bc2010-01-14 01:40:04219 RegisterFunction<BookmarkManagerGetStringsFunction>();
[email protected]ced90ae12010-02-20 02:06:16220 RegisterFunction<StartDragBookmarkManagerFunction>();
221 RegisterFunction<DropBookmarkManagerFunction>();
[email protected]9b071852010-04-02 06:45:31222 RegisterFunction<GetSubtreeBookmarkManagerFunction>();
[email protected]933ebbe2011-06-30 12:24:01223 RegisterFunction<CanEditBookmarkManagerFunction>();
[email protected]9dd97bc2010-01-14 01:40:04224
[email protected]de768a832009-10-30 05:25:01225 // History
226 RegisterFunction<AddUrlHistoryFunction>();
227 RegisterFunction<DeleteAllHistoryFunction>();
228 RegisterFunction<DeleteRangeHistoryFunction>();
229 RegisterFunction<DeleteUrlHistoryFunction>();
230 RegisterFunction<GetVisitsHistoryFunction>();
231 RegisterFunction<SearchHistoryFunction>();
232
[email protected]f5205412010-03-16 00:19:34233 // Idle
234 RegisterFunction<ExtensionIdleQueryStateFunction>();
235
[email protected]198bcfe2009-09-09 22:56:28236 // I18N.
[email protected]61424c062009-10-14 23:14:59237 RegisterFunction<GetAcceptLanguagesFunction>();
[email protected]198bcfe2009-09-09 22:56:28238
[email protected]381162b2010-01-28 17:29:35239 // Processes.
[email protected]8a661f82010-10-19 21:47:11240 RegisterFunction<GetProcessIdForTabFunction>();
[email protected]381162b2010-01-28 17:29:35241
[email protected]438772df2010-02-26 18:08:43242 // Metrics.
[email protected]cf25e4d2010-03-12 21:19:34243 RegisterFunction<MetricsRecordUserActionFunction>();
244 RegisterFunction<MetricsRecordValueFunction>();
245 RegisterFunction<MetricsRecordPercentageFunction>();
246 RegisterFunction<MetricsRecordCountFunction>();
247 RegisterFunction<MetricsRecordSmallCountFunction>();
248 RegisterFunction<MetricsRecordMediumCountFunction>();
249 RegisterFunction<MetricsRecordTimeFunction>();
250 RegisterFunction<MetricsRecordMediumTimeFunction>();
251 RegisterFunction<MetricsRecordLongTimeFunction>();
[email protected]438772df2010-02-26 18:08:43252
[email protected]17d40f02010-07-01 01:18:06253 // RLZ.
254#if defined(OS_WIN)
255 RegisterFunction<RlzRecordProductEventFunction>();
256 RegisterFunction<RlzGetAccessPointRlzFunction>();
[email protected]3a612be2010-07-17 03:11:21257 RegisterFunction<RlzSendFinancialPingFunction>();
[email protected]17d40f02010-07-01 01:18:06258 RegisterFunction<RlzClearProductStateFunction>();
259#endif
260
[email protected]898bbd32010-05-18 18:52:29261 // Cookies.
262 RegisterFunction<GetCookieFunction>();
263 RegisterFunction<GetAllCookiesFunction>();
264 RegisterFunction<SetCookieFunction>();
265 RegisterFunction<RemoveCookieFunction>();
266 RegisterFunction<GetAllCookieStoresFunction>();
267
[email protected]25fd1b2e2009-08-17 20:57:14268 // Test.
[email protected]61424c062009-10-14 23:14:59269 RegisterFunction<ExtensionTestPassFunction>();
270 RegisterFunction<ExtensionTestFailFunction>();
271 RegisterFunction<ExtensionTestLogFunction>();
[email protected]d13950e2009-12-04 01:43:02272 RegisterFunction<ExtensionTestQuotaResetFunction>();
[email protected]db7331a2010-02-25 22:10:50273 RegisterFunction<ExtensionTestCreateIncognitoTabFunction>();
[email protected]745feedb2010-08-02 04:08:07274 RegisterFunction<ExtensionTestSendMessageFunction>();
[email protected]761e7162010-10-18 19:26:39275 RegisterFunction<ExtensionTestGetConfigFunction>();
[email protected]5cbe1e22010-01-30 01:18:56276
277 // Accessibility.
278 RegisterFunction<GetFocusedControlFunction>();
279 RegisterFunction<SetAccessibilityEnabledFunction>();
[email protected]446255952010-03-17 20:41:58280
[email protected]8abe0a32010-08-12 00:40:22281 // Text-to-speech.
[email protected]c63f2b72011-07-07 05:25:00282 RegisterFunction<ExtensionTtsEngineSendTtsEventFunction>();
283 RegisterFunction<ExtensionTtsGetVoicesFunction>();
284 RegisterFunction<ExtensionTtsIsSpeakingFunction>();
[email protected]8abe0a32010-08-12 00:40:22285 RegisterFunction<ExtensionTtsSpeakFunction>();
286 RegisterFunction<ExtensionTtsStopSpeakingFunction>();
[email protected]8abe0a32010-08-12 00:40:22287
[email protected]2e3b5202010-03-23 06:52:41288 // Context Menus.
289 RegisterFunction<CreateContextMenuFunction>();
[email protected]66dbfb2c2010-05-12 20:20:15290 RegisterFunction<UpdateContextMenuFunction>();
[email protected]2e3b5202010-03-23 06:52:41291 RegisterFunction<RemoveContextMenuFunction>();
[email protected]66dbfb2c2010-05-12 20:20:15292 RegisterFunction<RemoveAllContextMenusFunction>();
[email protected]56ad3792010-05-28 17:45:33293
294 // Omnibox.
295 RegisterFunction<OmniboxSendSuggestionsFunction>();
[email protected]1bead0712010-11-27 17:41:53296 RegisterFunction<OmniboxSetDefaultSuggestionFunction>();
[email protected]a9c23a52010-08-04 09:13:44297
[email protected]8b8e7c92010-08-19 18:05:56298 // Sidebar.
299 RegisterFunction<CollapseSidebarFunction>();
300 RegisterFunction<ExpandSidebarFunction>();
301 RegisterFunction<GetStateSidebarFunction>();
302 RegisterFunction<HideSidebarFunction>();
303 RegisterFunction<NavigateSidebarFunction>();
304 RegisterFunction<SetBadgeTextSidebarFunction>();
305 RegisterFunction<SetIconSidebarFunction>();
306 RegisterFunction<SetTitleSidebarFunction>();
307 RegisterFunction<ShowSidebarFunction>();
[email protected]d6833852010-08-20 18:00:45308
[email protected]e06a1fe2011-09-29 21:20:44309 // Speech input.
310 RegisterFunction<StartSpeechInputFunction>();
311 RegisterFunction<StopSpeechInputFunction>();
312 RegisterFunction<IsRecordingSpeechInputFunction>();
313
[email protected]d6833852010-08-20 18:00:45314#if defined(TOOLKIT_VIEWS)
315 // Input.
316 RegisterFunction<SendKeyboardEventInputFunction>();
317#endif
[email protected]cffd7892010-08-26 17:43:28318
[email protected]2cc81d32011-10-04 17:03:18319#if defined(USE_VIRTUAL_KEYBOARD)
[email protected]bcde7482011-05-23 19:29:12320 RegisterFunction<HideKeyboardFunction>();
[email protected]3c8faef2011-06-09 22:56:51321 RegisterFunction<SetKeyboardHeightFunction>();
[email protected]bcde7482011-05-23 19:29:12322#endif
323
[email protected]14da67b02011-08-02 05:49:13324#if defined(OS_CHROMEOS)
[email protected]27072cad2011-05-09 19:46:40325 // IME
[email protected]14da67b02011-08-02 05:49:13326 RegisterFunction<SetCompositionFunction>();
327 RegisterFunction<ClearCompositionFunction>();
328 RegisterFunction<CommitTextFunction>();
329 RegisterFunction<SetCandidateWindowPropertiesFunction>();
330 RegisterFunction<SetCandidatesFunction>();
331 RegisterFunction<SetCursorPositionFunction>();
332 RegisterFunction<SetMenuItemsFunction>();
333 RegisterFunction<UpdateMenuItemsFunction>();
[email protected]cd0b04c92011-09-08 05:18:06334
335 RegisterFunction<InputEventHandled>();
[email protected]9a2aebe02011-12-02 21:54:14336#if defined(USE_VIRTUAL_KEYBOARD)
[email protected]27072cad2011-05-09 19:46:40337 RegisterFunction<CandidateClickedInputUiFunction>();
338 RegisterFunction<CursorUpInputUiFunction>();
339 RegisterFunction<CursorDownInputUiFunction>();
340 RegisterFunction<PageUpInputUiFunction>();
341 RegisterFunction<PageDownInputUiFunction>();
342 RegisterFunction<RegisterInputUiFunction>();
343 RegisterFunction<PageUpInputUiFunction>();
344 RegisterFunction<PageDownInputUiFunction>();
345#endif
[email protected]14da67b02011-08-02 05:49:13346#endif
[email protected]27072cad2011-05-09 19:46:40347
[email protected]cffd7892010-08-26 17:43:28348 // Management.
349 RegisterFunction<GetAllExtensionsFunction>();
[email protected]e78543c2010-11-08 22:05:23350 RegisterFunction<GetExtensionByIdFunction>();
[email protected]925a54d2011-07-29 17:21:00351 RegisterFunction<GetPermissionWarningsByIdFunction>();
352 RegisterFunction<GetPermissionWarningsByManifestFunction>();
[email protected]e558ff82010-09-23 20:19:56353 RegisterFunction<LaunchAppFunction>();
[email protected]cffd7892010-08-26 17:43:28354 RegisterFunction<SetEnabledFunction>();
[email protected]cffd7892010-08-26 17:43:28355 RegisterFunction<UninstallFunction>();
[email protected]63cda0c2010-09-01 04:41:23356
[email protected]a65882c2010-11-12 15:15:09357 // Extension module.
358 RegisterFunction<SetUpdateUrlDataFunction>();
[email protected]c7c401d2011-03-16 10:20:01359 RegisterFunction<IsAllowedIncognitoAccessFunction>();
360 RegisterFunction<IsAllowedFileSchemeAccessFunction>();
[email protected]a65882c2010-11-12 15:15:09361
[email protected]63cda0c2010-09-01 04:41:23362 // WebstorePrivate.
[email protected]d6885592010-10-11 19:38:24363 RegisterFunction<GetBrowserLoginFunction>();
[email protected]63cda0c2010-09-01 04:41:23364 RegisterFunction<GetStoreLoginFunction>();
365 RegisterFunction<SetStoreLoginFunction>();
[email protected]5349ac6d2011-04-05 22:20:17366 RegisterFunction<BeginInstallWithManifestFunction>();
[email protected]b1f04cc2010-11-10 22:59:30367 RegisterFunction<CompleteInstallFunction>();
[email protected]f66a50a2011-11-02 23:53:46368 RegisterFunction<SilentlyInstallFunction>();
[email protected]979b69c2011-12-08 23:19:55369 RegisterFunction<GetWebGLStatusFunction>();
[email protected]c41fe662011-02-15 01:19:26370
[email protected]557a51dd2011-07-26 12:17:11371 // WebNavigation.
372 RegisterFunction<GetFrameFunction>();
[email protected]5a130672011-09-09 08:42:29373 RegisterFunction<GetAllFramesFunction>();
[email protected]557a51dd2011-07-26 12:17:11374
[email protected]c41fe662011-02-15 01:19:26375 // WebRequest.
376 RegisterFunction<WebRequestAddEventListener>();
[email protected]05cc4e72011-03-08 21:29:48377 RegisterFunction<WebRequestEventHandled>();
[email protected]e81d4d72011-09-29 16:54:31378 RegisterFunction<WebRequestHandlerBehaviorChanged>();
[email protected]598bbcc2011-02-24 10:03:25379
380 // Preferences.
381 RegisterFunction<GetPreferenceFunction>();
382 RegisterFunction<SetPreferenceFunction>();
[email protected]c433bcb2011-02-24 13:10:27383 RegisterFunction<ClearPreferenceFunction>();
[email protected]91ba3312011-03-17 20:39:22384
[email protected]b6b805e92011-04-16 09:24:14385 // ChromeOS-specific part of the API.
386#if defined(OS_CHROMEOS)
387 // Device Customization.
388 RegisterFunction<GetChromeosInfoFunction>();
389
390 // FileBrowserPrivate functions.
[email protected]04ef5152011-11-18 04:05:25391 // TODO(jamescook): Expose these on non-ChromeOS platforms so we can use
392 // the extension-based file picker on Aura. crbug.com/97424
[email protected]94bda202011-04-18 23:31:00393 RegisterFunction<CancelFileDialogFunction>();
[email protected]b6b805e92011-04-16 09:24:14394 RegisterFunction<ExecuteTasksFileBrowserFunction>();
[email protected]94bda202011-04-18 23:31:00395 RegisterFunction<FileDialogStringsFunction>();
[email protected]b6b805e92011-04-16 09:24:14396 RegisterFunction<GetFileTasksFileBrowserFunction>();
[email protected]61334fa2011-06-16 01:01:40397 RegisterFunction<GetVolumeMetadataFunction>();
[email protected]b6b805e92011-04-16 09:24:14398 RegisterFunction<RequestLocalFileSystemFunction>();
[email protected]a6d06642011-06-02 05:55:23399 RegisterFunction<AddFileWatchBrowserFunction>();
400 RegisterFunction<RemoveFileWatchBrowserFunction>();
[email protected]9d4c2c52011-04-07 18:53:10401 RegisterFunction<SelectFileFunction>();
402 RegisterFunction<SelectFilesFunction>();
[email protected]928ae8852011-07-26 01:15:03403 RegisterFunction<AddMountFunction>();
404 RegisterFunction<RemoveMountFunction>();
405 RegisterFunction<GetMountPointsFunction>();
[email protected]694cafac2011-09-21 17:41:53406 RegisterFunction<GetSizeStatsFunction>();
[email protected]3fd9004c2011-08-12 00:58:46407 RegisterFunction<FormatDeviceFunction>();
[email protected]94bda202011-04-18 23:31:00408 RegisterFunction<ViewFilesFunction>();
[email protected]f1852b52011-05-17 04:58:08409
[email protected]ce9802042011-05-27 10:11:40410 // Mediaplayer
411 RegisterFunction<PlayAtMediaplayerFunction>();
412 RegisterFunction<SetPlaybackErrorMediaplayerFunction>();
413 RegisterFunction<GetPlaylistMediaplayerFunction>();
414 RegisterFunction<TogglePlaylistPanelMediaplayerFunction>();
415 RegisterFunction<ToggleFullscreenMediaplayerFunction>();
[email protected]be5bd5742011-07-14 07:21:01416
417 // InputMethod
418 RegisterFunction<GetInputMethodFunction>();
419
[email protected]8f427982011-12-13 23:40:23420 // Terminal
421 RegisterFunction<OpenTerminalProcessFunction>();
422 RegisterFunction<SendInputToTerminalProcessFunction>();
423 RegisterFunction<CloseTerminalProcessFunction>();
424
[email protected]9a2aebe02011-12-02 21:54:14425#if defined(USE_VIRTUAL_KEYBOARD)
[email protected]f1852b52011-05-17 04:58:08426 // Input
427 RegisterFunction<SendHandwritingStrokeFunction>();
428 RegisterFunction<CancelHandwritingStrokesFunction>();
429#endif
[email protected]61b55b62011-03-24 09:03:10430#endif
431
[email protected]c6e584c2011-05-18 11:58:44432 // Websocket to TCP proxy. Currently noop on anything other than ChromeOS.
433 RegisterFunction<WebSocketProxyPrivateGetPassportForTCPFunction>();
[email protected]5ddffb82011-10-14 17:48:07434 RegisterFunction<WebSocketProxyPrivateGetURLForTCPFunction>();
[email protected]c6e584c2011-05-18 11:58:44435
[email protected]91ba3312011-03-17 20:39:22436 // Debugger
437 RegisterFunction<AttachDebuggerFunction>();
438 RegisterFunction<DetachDebuggerFunction>();
[email protected]c7580b62011-10-26 08:46:30439 RegisterFunction<SendCommandDebuggerFunction>();
[email protected]fa0624262011-06-09 14:17:38440
[email protected]b7f853e282011-08-10 09:24:20441 // Settings
[email protected]0d9a2202011-11-09 13:48:41442 RegisterFunction<extensions::GetSettingsFunction>();
443 RegisterFunction<extensions::SetSettingsFunction>();
444 RegisterFunction<extensions::RemoveSettingsFunction>();
445 RegisterFunction<extensions::ClearSettingsFunction>();
[email protected]b7f853e282011-08-10 09:24:20446
[email protected]fa0624262011-06-09 14:17:38447 // Content settings.
[email protected]49ba4822011-06-15 18:41:56448 RegisterFunction<GetResourceIdentifiersFunction>();
[email protected]fa0624262011-06-09 14:17:38449 RegisterFunction<ClearContentSettingsFunction>();
450 RegisterFunction<GetContentSettingFunction>();
451 RegisterFunction<SetContentSettingFunction>();
[email protected]c1d05aa2011-06-28 02:07:30452
[email protected]be9d9c82011-07-13 04:17:31453 // ChromeAuth settings.
454 RegisterFunction<SetCloudPrintCredentialsFunction>();
455
[email protected]c1d05aa2011-06-28 02:07:30456 // Experimental App API.
457 RegisterFunction<AppNotifyFunction>();
458 RegisterFunction<AppClearAllNotificationsFunction>();
[email protected]902fd7b2011-07-27 18:42:31459
460 // Permissions
461 RegisterFunction<ContainsPermissionsFunction>();
462 RegisterFunction<GetAllPermissionsFunction>();
463 RegisterFunction<RemovePermissionsFunction>();
464 RegisterFunction<RequestPermissionsFunction>();
[email protected]21d7a4e302011-08-15 16:17:12465
466 // Downloads
467 RegisterFunction<DownloadsDownloadFunction>();
468 RegisterFunction<DownloadsSearchFunction>();
469 RegisterFunction<DownloadsPauseFunction>();
470 RegisterFunction<DownloadsResumeFunction>();
471 RegisterFunction<DownloadsCancelFunction>();
472 RegisterFunction<DownloadsEraseFunction>();
473 RegisterFunction<DownloadsSetDestinationFunction>();
474 RegisterFunction<DownloadsAcceptDangerFunction>();
475 RegisterFunction<DownloadsShowFunction>();
476 RegisterFunction<DownloadsDragFunction>();
[email protected]3a605e82011-09-26 17:26:16477
[email protected]9e4430f2011-11-28 07:43:29478 // PageCapture
479 RegisterFunction<PageCaptureSaveAsMHTMLFunction>();
[email protected]6a16dc9b2011-10-17 18:28:16480
[email protected]5eddc3e2011-10-26 04:33:31481 // TopSites
482 RegisterFunction<GetTopSitesFunction>();
[email protected]ae7f1ba2011-11-28 23:07:31483
484 // Sockets
485 RegisterFunction<extensions::SocketCreateFunction>();
[email protected]55afeb52011-12-06 00:15:39486 RegisterFunction<extensions::SocketDestroyFunction>();
[email protected]ae7f1ba2011-11-28 23:07:31487 RegisterFunction<extensions::SocketConnectFunction>();
[email protected]55afeb52011-12-06 00:15:39488 RegisterFunction<extensions::SocketCloseFunction>();
489 RegisterFunction<extensions::SocketWriteFunction>();
[email protected]a4f98922011-12-06 11:32:23490
491 // System
492 RegisterFunction<extensions::GetIncognitoModeAvailabilityFunction>();
[email protected]bfdffe2b2009-04-24 22:05:35493}
494
[email protected]b83e4602009-05-15 22:58:33495void FactoryRegistry::GetAllNames(std::vector<std::string>* names) {
496 for (FactoryMap::iterator iter = factories_.begin();
497 iter != factories_.end(); ++iter) {
[email protected]bfdffe2b2009-04-24 22:05:35498 names->push_back(iter->first);
499 }
500}
501
[email protected]b83e4602009-05-15 22:58:33502bool FactoryRegistry::OverrideFunction(const std::string& name,
503 ExtensionFunctionFactory factory) {
504 FactoryMap::iterator iter = factories_.find(name);
505 if (iter == factories_.end()) {
506 return false;
507 } else {
508 iter->second = factory;
509 return true;
510 }
511}
512
[email protected]bfdffe2b2009-04-24 22:05:35513ExtensionFunction* FactoryRegistry::NewFunction(const std::string& name) {
514 FactoryMap::iterator iter = factories_.find(name);
515 DCHECK(iter != factories_.end());
[email protected]b83e4602009-05-15 22:58:33516 ExtensionFunction* function = iter->second();
[email protected]76a3db852009-07-24 02:14:56517 function->set_name(name);
[email protected]b83e4602009-05-15 22:58:33518 return function;
[email protected]bfdffe2b2009-04-24 22:05:35519}
520
[email protected]b83e4602009-05-15 22:58:33521}; // namespace
[email protected]bfdffe2b2009-04-24 22:05:35522
523// ExtensionFunctionDispatcher -------------------------------------------------
524
525void ExtensionFunctionDispatcher::GetAllFunctionNames(
526 std::vector<std::string>* names) {
[email protected]8e8bb6d2010-12-13 08:18:55527 FactoryRegistry::GetInstance()->GetAllNames(names);
[email protected]bfdffe2b2009-04-24 22:05:35528}
529
[email protected]b83e4602009-05-15 22:58:33530bool ExtensionFunctionDispatcher::OverrideFunction(
531 const std::string& name, ExtensionFunctionFactory factory) {
[email protected]8e8bb6d2010-12-13 08:18:55532 return FactoryRegistry::GetInstance()->OverrideFunction(name, factory);
[email protected]b83e4602009-05-15 22:58:33533}
534
535void ExtensionFunctionDispatcher::ResetFunctions() {
[email protected]8e8bb6d2010-12-13 08:18:55536 FactoryRegistry::GetInstance()->ResetFunctions();
[email protected]b83e4602009-05-15 22:58:33537}
538
[email protected]c357acb42011-06-09 20:52:42539// static
540void ExtensionFunctionDispatcher::DispatchOnIOThread(
[email protected]fd50e7b2011-11-03 09:20:25541 ExtensionInfoMap* extension_info_map,
[email protected]673514522011-07-13 18:17:18542 void* profile,
[email protected]c357acb42011-06-09 20:52:42543 int render_process_id,
544 base::WeakPtr<ChromeRenderMessageFilter> ipc_sender,
545 int routing_id,
546 const ExtensionHostMsg_Request_Params& params) {
547 const Extension* extension =
[email protected]83820d42011-11-12 22:03:11548 extension_info_map->extensions().GetByID(params.extension_id);
[email protected]c357acb42011-06-09 20:52:42549
[email protected]6f371442011-11-09 06:45:46550 scoped_refptr<ExtensionFunction> function(
551 CreateExtensionFunction(params, extension, render_process_id,
552 extension_info_map->process_map(), profile,
553 ipc_sender, routing_id));
[email protected]c357acb42011-06-09 20:52:42554 if (!function)
555 return;
556
557 IOThreadExtensionFunction* function_io =
558 function->AsIOThreadExtensionFunction();
559 if (!function_io) {
560 NOTREACHED();
561 return;
562 }
563 function_io->set_ipc_sender(ipc_sender, routing_id);
564 function_io->set_extension_info_map(extension_info_map);
565 function->set_include_incognito(
566 extension_info_map->IsIncognitoEnabled(extension->id()));
[email protected]fd50e7b2011-11-03 09:20:25567
568 ExtensionsQuotaService* quota = extension_info_map->quota_service();
569 if (quota->Assess(extension->id(), function, &params.arguments,
570 base::TimeTicks::Now())) {
571 function->Run();
572 } else {
573 function->OnQuotaExceeded();
574 }
[email protected]c357acb42011-06-09 20:52:42575}
576
[email protected]c5dbef02011-05-13 05:06:09577ExtensionFunctionDispatcher::ExtensionFunctionDispatcher(Profile* profile,
578 Delegate* delegate)
579 : profile_(profile),
[email protected]55ce330712011-05-24 19:04:27580 delegate_(delegate) {
[email protected]bfdffe2b2009-04-24 22:05:35581}
582
[email protected]32dda362009-06-05 19:07:01583ExtensionFunctionDispatcher::~ExtensionFunctionDispatcher() {
[email protected]32dda362009-06-05 19:07:01584}
585
[email protected]0ec92032010-03-24 19:59:41586Browser* ExtensionFunctionDispatcher::GetCurrentBrowser(
[email protected]c5dbef02011-05-13 05:06:09587 RenderViewHost* render_view_host, bool include_incognito) {
[email protected]0ec92032010-03-24 19:59:41588 Browser* browser = delegate_->GetBrowser();
[email protected]7eecaed52009-05-07 21:44:12589
[email protected]bc535ee52010-08-31 18:40:32590 // If the delegate has an associated browser, that is always the right answer.
591 if (browser)
592 return browser;
[email protected]9c45b7182009-08-04 16:44:43593
[email protected]bc535ee52010-08-31 18:40:32594 // Otherwise, try to default to a reasonable browser. If |include_incognito|
595 // is true, we will also search browsers in the incognito version of this
596 // profile. Note that the profile may already be incognito, in which case
597 // we will search the incognito version only, regardless of the value of
598 // |include_incognito|.
[email protected]9b62ecf2011-07-27 20:23:08599 Profile* profile = Profile::FromBrowserContext(
[email protected]f3b1a082011-11-18 00:34:30600 render_view_host->process()->GetBrowserContext());
[email protected]b35b26b32011-05-05 20:35:14601 browser = BrowserList::FindTabbedBrowser(profile, include_incognito);
[email protected]0ec92032010-03-24 19:59:41602
[email protected]0ec92032010-03-24 19:59:41603 // NOTE(rafaelw): This can return NULL in some circumstances. In particular,
[email protected]6d7a6042010-08-12 20:12:42604 // a background_page onload chrome.tabs api call can make it into here
605 // before the browser is sufficiently initialized to return here.
[email protected]0ec92032010-03-24 19:59:41606 // A similar situation may arise during shutdown.
607 // TODO(rafaelw): Delay creation of background_page until the browser
608 // is available. http://code.google.com/p/chromium/issues/detail?id=13284
609 return browser;
[email protected]b27257562009-11-16 23:28:26610}
611
[email protected]c5dbef02011-05-13 05:06:09612void ExtensionFunctionDispatcher::Dispatch(
613 const ExtensionHostMsg_Request_Params& params,
614 RenderViewHost* render_view_host) {
[email protected]c5dbef02011-05-13 05:06:09615 ExtensionService* service = profile()->GetExtensionService();
[email protected]6f371442011-11-09 06:45:46616 extensions::ProcessMap* process_map = service->process_map();
617 if (!service || !process_map)
[email protected]c5dbef02011-05-13 05:06:09618 return;
619
[email protected]615d88f2011-12-13 01:47:44620 const Extension* extension = service->extensions()->GetByID(
621 params.extension_id);
[email protected]c5dbef02011-05-13 05:06:09622 if (!extension)
[email protected]615d88f2011-12-13 01:47:44623 extension = service->extensions()->GetHostedAppByURL(ExtensionURLInfo(
624 WebSecurityOrigin::createFromString(params.source_origin),
625 params.source_url));
[email protected]c5dbef02011-05-13 05:06:09626
[email protected]8add5412011-10-01 21:02:14627 scoped_refptr<ExtensionFunction> function(
[email protected]6f371442011-11-09 06:45:46628 CreateExtensionFunction(params, extension,
[email protected]f3b1a082011-11-18 00:34:30629 render_view_host->process()->GetID(),
[email protected]6f371442011-11-09 06:45:46630 *(service->process_map()),
631 profile(), render_view_host,
[email protected]8add5412011-10-01 21:02:14632 render_view_host->routing_id()));
[email protected]c357acb42011-06-09 20:52:42633 if (!function)
[email protected]f82d57b52011-04-27 19:13:17634 return;
[email protected]f82d57b52011-04-27 19:13:17635
[email protected]a2aef2e2011-05-26 22:48:12636 UIThreadExtensionFunction* function_ui =
637 function->AsUIThreadExtensionFunction();
638 if (!function_ui) {
639 NOTREACHED();
640 return;
641 }
642 function_ui->SetRenderViewHost(render_view_host);
643 function_ui->set_dispatcher(AsWeakPtr());
644 function_ui->set_profile(profile_);
[email protected]2a8f24e2010-11-03 21:37:05645 function->set_include_incognito(service->CanCrossIncognito(extension));
[email protected]cb0ce1e022010-03-10 19:54:41646
[email protected]d13950e2009-12-04 01:43:02647 ExtensionsQuotaService* quota = service->quota_service();
[email protected]c5dbef02011-05-13 05:06:09648 if (quota->Assess(extension->id(), function, &params.arguments,
[email protected]8b8e7c92010-08-19 18:05:56649 base::TimeTicks::Now())) {
[email protected]d070ec62010-07-27 21:28:26650 // See crbug.com/39178.
651 ExternalProtocolHandler::PermitLaunchUrl();
652
[email protected]d13950e2009-12-04 01:43:02653 function->Run();
654 } else {
[email protected]fd50e7b2011-11-03 09:20:25655 function->OnQuotaExceeded();
[email protected]d13950e2009-12-04 01:43:02656 }
[email protected]bfdffe2b2009-04-24 22:05:35657}
658
[email protected]c357acb42011-06-09 20:52:42659// static
660ExtensionFunction* ExtensionFunctionDispatcher::CreateExtensionFunction(
661 const ExtensionHostMsg_Request_Params& params,
662 const Extension* extension,
[email protected]6f371442011-11-09 06:45:46663 int requesting_process_id,
664 const extensions::ProcessMap& process_map,
[email protected]673514522011-07-13 18:17:18665 void* profile,
[email protected]c357acb42011-06-09 20:52:42666 IPC::Message::Sender* ipc_sender,
667 int routing_id) {
[email protected]c357acb42011-06-09 20:52:42668 if (!extension) {
[email protected]6f371442011-11-09 06:45:46669 LOG(ERROR) << "Specified extension does not exist.";
670 SendAccessDenied(ipc_sender, routing_id, params.request_id);
671 return NULL;
672 }
673
[email protected]83820d42011-11-12 22:03:11674 if (ExtensionAPI::GetInstance()->IsPrivileged(params.name) &&
675 !process_map.Contains(extension->id(), requesting_process_id)) {
[email protected]6f371442011-11-09 06:45:46676 LOG(ERROR) << "Extension API called from incorrect process "
677 << requesting_process_id
678 << " from URL " << params.source_url.spec();
[email protected]c357acb42011-06-09 20:52:42679 SendAccessDenied(ipc_sender, routing_id, params.request_id);
680 return NULL;
681 }
682
[email protected]0d3e4a22011-06-23 19:02:52683 if (!extension->HasAPIPermission(params.name)) {
[email protected]c357acb42011-06-09 20:52:42684 LOG(ERROR) << "Extension " << extension->id() << " does not have "
685 << "permission to function: " << params.name;
686 SendAccessDenied(ipc_sender, routing_id, params.request_id);
687 return NULL;
688 }
689
690 ExtensionFunction* function =
691 FactoryRegistry::GetInstance()->NewFunction(params.name);
692 function->SetArgs(&params.arguments);
693 function->set_source_url(params.source_url);
694 function->set_request_id(params.request_id);
695 function->set_has_callback(params.has_callback);
696 function->set_user_gesture(params.user_gesture);
697 function->set_extension(extension);
[email protected]637bf322011-10-01 20:46:32698 function->set_profile_id(profile);
[email protected]c357acb42011-06-09 20:52:42699 return function;
700}
701
702// static
[email protected]c5dbef02011-05-13 05:06:09703void ExtensionFunctionDispatcher::SendAccessDenied(
[email protected]c357acb42011-06-09 20:52:42704 IPC::Message::Sender* ipc_sender, int routing_id, int request_id) {
705 ipc_sender->Send(new ExtensionMsg_Response(
706 routing_id, request_id, false, std::string(),
[email protected]c5dbef02011-05-13 05:06:09707 "Access to extension API denied."));
[email protected]bfdffe2b2009-04-24 22:05:35708}