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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 scoped_ptr<NativeHandler>(new AppBindings(this, context))); | 610 scoped_ptr<NativeHandler>(new AppBindings(this, context))); |
611 module_system->RegisterNativeHandler("app_window", | 611 module_system->RegisterNativeHandler("app_window", |
612 scoped_ptr<NativeHandler>(new AppWindowCustomBindings(this))); | 612 scoped_ptr<NativeHandler>(new AppWindowCustomBindings(this))); |
613 module_system->RegisterNativeHandler("context_menus", | 613 module_system->RegisterNativeHandler("context_menus", |
614 scoped_ptr<NativeHandler>(new ContextMenusCustomBindings())); | 614 scoped_ptr<NativeHandler>(new ContextMenusCustomBindings())); |
615 module_system->RegisterNativeHandler("extension", | 615 module_system->RegisterNativeHandler("extension", |
616 scoped_ptr<NativeHandler>( | 616 scoped_ptr<NativeHandler>( |
617 new ExtensionCustomBindings(this))); | 617 new ExtensionCustomBindings(this))); |
618 module_system->RegisterNativeHandler("experimental_app", | 618 module_system->RegisterNativeHandler("experimental_app", |
619 scoped_ptr<NativeHandler>(new ExperimentalAppCustomBindings())); | 619 scoped_ptr<NativeHandler>(new ExperimentalAppCustomBindings())); |
| 620 #if !defined(OS_ANDROID) |
620 module_system->RegisterNativeHandler("experimental_usb", | 621 module_system->RegisterNativeHandler("experimental_usb", |
621 scoped_ptr<NativeHandler>(new ExperimentalUsbCustomBindings())); | 622 scoped_ptr<NativeHandler>(new ExperimentalUsbCustomBindings())); |
| 623 #endif |
622 module_system->RegisterNativeHandler("file_browser_handler", | 624 module_system->RegisterNativeHandler("file_browser_handler", |
623 scoped_ptr<NativeHandler>(new FileBrowserHandlerCustomBindings())); | 625 scoped_ptr<NativeHandler>(new FileBrowserHandlerCustomBindings())); |
624 module_system->RegisterNativeHandler("file_browser_private", | 626 module_system->RegisterNativeHandler("file_browser_private", |
625 scoped_ptr<NativeHandler>(new FileBrowserPrivateCustomBindings())); | 627 scoped_ptr<NativeHandler>(new FileBrowserPrivateCustomBindings())); |
626 module_system->RegisterNativeHandler("i18n", | 628 module_system->RegisterNativeHandler("i18n", |
627 scoped_ptr<NativeHandler>(new I18NCustomBindings())); | 629 scoped_ptr<NativeHandler>(new I18NCustomBindings())); |
628 module_system->RegisterNativeHandler("mediaGalleries", | 630 module_system->RegisterNativeHandler("mediaGalleries", |
629 scoped_ptr<NativeHandler>(new MediaGalleryCustomBindings())); | 631 scoped_ptr<NativeHandler>(new MediaGalleryCustomBindings())); |
630 module_system->RegisterNativeHandler("page_actions", | 632 module_system->RegisterNativeHandler("page_actions", |
631 scoped_ptr<NativeHandler>( | 633 scoped_ptr<NativeHandler>( |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 // APIs, they don't get extension bindings injected. If we end up here it | 1139 // APIs, they don't get extension bindings injected. If we end up here it |
1138 // means that a sandboxed page somehow managed to invoke an API anyway, so | 1140 // means that a sandboxed page somehow managed to invoke an API anyway, so |
1139 // we should abort. | 1141 // we should abort. |
1140 WebKit::WebFrame* frame = context->web_frame(); | 1142 WebKit::WebFrame* frame = context->web_frame(); |
1141 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1143 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
1142 extensions::UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1144 extensions::UserScriptSlave::GetDataSourceURLForFrame(frame)); |
1143 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1145 CHECK(!extensions_.IsSandboxedPage(url_info)); |
1144 | 1146 |
1145 return true; | 1147 return true; |
1146 } | 1148 } |
OLD | NEW |