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/renderer/extensions/extension_dispatcher.h" | 5 #include "chrome/renderer/extensions/extension_dispatcher.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 scoped_ptr<NativeHandler>(new AppBindings(this, context))); | 616 scoped_ptr<NativeHandler>(new AppBindings(this, context))); |
617 module_system->RegisterNativeHandler("app_window", | 617 module_system->RegisterNativeHandler("app_window", |
618 scoped_ptr<NativeHandler>(new AppWindowCustomBindings(this))); | 618 scoped_ptr<NativeHandler>(new AppWindowCustomBindings(this))); |
619 module_system->RegisterNativeHandler("context_menus", | 619 module_system->RegisterNativeHandler("context_menus", |
620 scoped_ptr<NativeHandler>(new ContextMenusCustomBindings())); | 620 scoped_ptr<NativeHandler>(new ContextMenusCustomBindings())); |
621 module_system->RegisterNativeHandler("extension", | 621 module_system->RegisterNativeHandler("extension", |
622 scoped_ptr<NativeHandler>( | 622 scoped_ptr<NativeHandler>( |
623 new ExtensionCustomBindings(this))); | 623 new ExtensionCustomBindings(this))); |
624 module_system->RegisterNativeHandler("experimental_app", | 624 module_system->RegisterNativeHandler("experimental_app", |
625 scoped_ptr<NativeHandler>(new ExperimentalAppCustomBindings())); | 625 scoped_ptr<NativeHandler>(new ExperimentalAppCustomBindings())); |
| 626 module_system->RegisterNativeHandler("experimental_mediaGalleries", |
| 627 scoped_ptr<NativeHandler>(new MediaGalleryCustomBindings())); |
626 module_system->RegisterNativeHandler("experimental_usb", | 628 module_system->RegisterNativeHandler("experimental_usb", |
627 scoped_ptr<NativeHandler>(new ExperimentalUsbCustomBindings())); | 629 scoped_ptr<NativeHandler>(new ExperimentalUsbCustomBindings())); |
628 module_system->RegisterNativeHandler("file_browser_handler", | 630 module_system->RegisterNativeHandler("file_browser_handler", |
629 scoped_ptr<NativeHandler>(new FileBrowserHandlerCustomBindings())); | 631 scoped_ptr<NativeHandler>(new FileBrowserHandlerCustomBindings())); |
630 module_system->RegisterNativeHandler("file_browser_private", | 632 module_system->RegisterNativeHandler("file_browser_private", |
631 scoped_ptr<NativeHandler>(new FileBrowserPrivateCustomBindings())); | 633 scoped_ptr<NativeHandler>(new FileBrowserPrivateCustomBindings())); |
632 module_system->RegisterNativeHandler("i18n", | 634 module_system->RegisterNativeHandler("i18n", |
633 scoped_ptr<NativeHandler>(new I18NCustomBindings())); | 635 scoped_ptr<NativeHandler>(new I18NCustomBindings())); |
634 module_system->RegisterNativeHandler("mediaGalleries", | |
635 scoped_ptr<NativeHandler>(new MediaGalleryCustomBindings())); | |
636 module_system->RegisterNativeHandler("page_actions", | 636 module_system->RegisterNativeHandler("page_actions", |
637 scoped_ptr<NativeHandler>( | 637 scoped_ptr<NativeHandler>( |
638 new PageActionsCustomBindings(this))); | 638 new PageActionsCustomBindings(this))); |
639 module_system->RegisterNativeHandler("page_capture", | 639 module_system->RegisterNativeHandler("page_capture", |
640 scoped_ptr<NativeHandler>(new PageCaptureCustomBindings())); | 640 scoped_ptr<NativeHandler>(new PageCaptureCustomBindings())); |
641 module_system->RegisterNativeHandler("runtime", | 641 module_system->RegisterNativeHandler("runtime", |
642 scoped_ptr<NativeHandler>(new RuntimeCustomBindings(context))); | 642 scoped_ptr<NativeHandler>(new RuntimeCustomBindings(context))); |
643 module_system->RegisterNativeHandler("tabs", | 643 module_system->RegisterNativeHandler("tabs", |
644 scoped_ptr<NativeHandler>(new TabsCustomBindings())); | 644 scoped_ptr<NativeHandler>(new TabsCustomBindings())); |
645 module_system->RegisterNativeHandler("tts", | 645 module_system->RegisterNativeHandler("tts", |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 IDR_EXPERIMENTAL_USB_CUSTOM_BINDINGS_JS); | 690 IDR_EXPERIMENTAL_USB_CUSTOM_BINDINGS_JS); |
691 source_map_.RegisterSource("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS); | 691 source_map_.RegisterSource("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS); |
692 source_map_.RegisterSource("fileBrowserHandler", | 692 source_map_.RegisterSource("fileBrowserHandler", |
693 IDR_FILE_BROWSER_HANDLER_CUSTOM_BINDINGS_JS); | 693 IDR_FILE_BROWSER_HANDLER_CUSTOM_BINDINGS_JS); |
694 source_map_.RegisterSource("fileBrowserPrivate", | 694 source_map_.RegisterSource("fileBrowserPrivate", |
695 IDR_FILE_BROWSER_PRIVATE_CUSTOM_BINDINGS_JS); | 695 IDR_FILE_BROWSER_PRIVATE_CUSTOM_BINDINGS_JS); |
696 source_map_.RegisterSource("fileSystem", | 696 source_map_.RegisterSource("fileSystem", |
697 IDR_FILE_SYSTEM_CUSTOM_BINDINGS_JS); | 697 IDR_FILE_SYSTEM_CUSTOM_BINDINGS_JS); |
698 source_map_.RegisterSource("i18n", IDR_I18N_CUSTOM_BINDINGS_JS); | 698 source_map_.RegisterSource("i18n", IDR_I18N_CUSTOM_BINDINGS_JS); |
699 source_map_.RegisterSource("input.ime", IDR_INPUT_IME_CUSTOM_BINDINGS_JS); | 699 source_map_.RegisterSource("input.ime", IDR_INPUT_IME_CUSTOM_BINDINGS_JS); |
700 source_map_.RegisterSource("mediaGalleries", | |
701 IDR_MEDIA_GALLERY_CUSTOM_BINDINGS_JS); | |
702 source_map_.RegisterSource("omnibox", IDR_OMNIBOX_CUSTOM_BINDINGS_JS); | 700 source_map_.RegisterSource("omnibox", IDR_OMNIBOX_CUSTOM_BINDINGS_JS); |
703 source_map_.RegisterSource("pageActions", | 701 source_map_.RegisterSource("pageActions", |
704 IDR_PAGE_ACTIONS_CUSTOM_BINDINGS_JS); | 702 IDR_PAGE_ACTIONS_CUSTOM_BINDINGS_JS); |
705 source_map_.RegisterSource("pageAction", IDR_PAGE_ACTION_CUSTOM_BINDINGS_JS); | 703 source_map_.RegisterSource("pageAction", IDR_PAGE_ACTION_CUSTOM_BINDINGS_JS); |
706 source_map_.RegisterSource("pageCapture", | 704 source_map_.RegisterSource("pageCapture", |
707 IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS); | 705 IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS); |
708 source_map_.RegisterSource("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS); | 706 source_map_.RegisterSource("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS); |
709 source_map_.RegisterSource("storage", IDR_STORAGE_CUSTOM_BINDINGS_JS); | 707 source_map_.RegisterSource("storage", IDR_STORAGE_CUSTOM_BINDINGS_JS); |
710 source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); | 708 source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); |
711 source_map_.RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); | 709 source_map_.RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 // APIs, they don't get extension bindings injected. If we end up here it | 1160 // APIs, they don't get extension bindings injected. If we end up here it |
1163 // means that a sandboxed page somehow managed to invoke an API anyway, so | 1161 // means that a sandboxed page somehow managed to invoke an API anyway, so |
1164 // we should abort. | 1162 // we should abort. |
1165 WebKit::WebFrame* frame = context->web_frame(); | 1163 WebKit::WebFrame* frame = context->web_frame(); |
1166 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1164 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
1167 extensions::UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1165 extensions::UserScriptSlave::GetDataSourceURLForFrame(frame)); |
1168 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1166 CHECK(!extensions_.IsSandboxedPage(url_info)); |
1169 | 1167 |
1170 return true; | 1168 return true; |
1171 } | 1169 } |
OLD | NEW |