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 #if !defined(OS_ANDROID) | |
joth
2012/08/03 15:20:11
this is slightly misleading, as none of these exte
Torne
2012/08/06 09:48:47
I expect this entire file won't be compiled at all
| |
626 module_system->RegisterNativeHandler("experimental_usb", | 627 module_system->RegisterNativeHandler("experimental_usb", |
627 scoped_ptr<NativeHandler>(new ExperimentalUsbCustomBindings())); | 628 scoped_ptr<NativeHandler>(new ExperimentalUsbCustomBindings())); |
629 #endif | |
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", | 636 module_system->RegisterNativeHandler("mediaGalleries", |
635 scoped_ptr<NativeHandler>(new MediaGalleryCustomBindings())); | 637 scoped_ptr<NativeHandler>(new MediaGalleryCustomBindings())); |
636 module_system->RegisterNativeHandler("page_actions", | 638 module_system->RegisterNativeHandler("page_actions", |
637 scoped_ptr<NativeHandler>( | 639 scoped_ptr<NativeHandler>( |
(...skipping 524 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 | 1164 // 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 | 1165 // means that a sandboxed page somehow managed to invoke an API anyway, so |
1164 // we should abort. | 1166 // we should abort. |
1165 WebKit::WebFrame* frame = context->web_frame(); | 1167 WebKit::WebFrame* frame = context->web_frame(); |
1166 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1168 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
1167 extensions::UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1169 extensions::UserScriptSlave::GetDataSourceURLForFrame(frame)); |
1168 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1170 CHECK(!extensions_.IsSandboxedPage(url_info)); |
1169 | 1171 |
1170 return true; | 1172 return true; |
1171 } | 1173 } |
OLD | NEW |