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/dispatcher.h" | 5 #include "chrome/renderer/extensions/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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 scoped_ptr<NativeHandler>(new AppBindings(this, context))); | 586 scoped_ptr<NativeHandler>(new AppBindings(this, context))); |
587 module_system->RegisterNativeHandler("app_runtime", | 587 module_system->RegisterNativeHandler("app_runtime", |
588 scoped_ptr<NativeHandler>(new AppRuntimeCustomBindings())); | 588 scoped_ptr<NativeHandler>(new AppRuntimeCustomBindings())); |
589 module_system->RegisterNativeHandler("app_window", | 589 module_system->RegisterNativeHandler("app_window", |
590 scoped_ptr<NativeHandler>(new AppWindowCustomBindings(this))); | 590 scoped_ptr<NativeHandler>(new AppWindowCustomBindings(this))); |
591 module_system->RegisterNativeHandler("context_menus", | 591 module_system->RegisterNativeHandler("context_menus", |
592 scoped_ptr<NativeHandler>(new ContextMenusCustomBindings())); | 592 scoped_ptr<NativeHandler>(new ContextMenusCustomBindings())); |
593 module_system->RegisterNativeHandler("extension", | 593 module_system->RegisterNativeHandler("extension", |
594 scoped_ptr<NativeHandler>( | 594 scoped_ptr<NativeHandler>( |
595 new ExtensionCustomBindings(this))); | 595 new ExtensionCustomBindings(this))); |
596 module_system->RegisterNativeHandler("sync_file_system", | |
597 scoped_ptr<NativeHandler>(new SyncFileSystemCustomBindings())); | |
598 module_system->RegisterNativeHandler("file_browser_handler", | 596 module_system->RegisterNativeHandler("file_browser_handler", |
599 scoped_ptr<NativeHandler>(new FileBrowserHandlerCustomBindings())); | 597 scoped_ptr<NativeHandler>(new FileBrowserHandlerCustomBindings())); |
600 module_system->RegisterNativeHandler("file_browser_private", | 598 module_system->RegisterNativeHandler("file_browser_private", |
601 scoped_ptr<NativeHandler>(new FileBrowserPrivateCustomBindings())); | 599 scoped_ptr<NativeHandler>(new FileBrowserPrivateCustomBindings())); |
602 module_system->RegisterNativeHandler("i18n", | 600 module_system->RegisterNativeHandler("i18n", |
603 scoped_ptr<NativeHandler>(new I18NCustomBindings())); | 601 scoped_ptr<NativeHandler>(new I18NCustomBindings())); |
604 module_system->RegisterNativeHandler("mediaGalleries", | 602 module_system->RegisterNativeHandler("mediaGalleries", |
605 scoped_ptr<NativeHandler>(new MediaGalleriesCustomBindings())); | 603 scoped_ptr<NativeHandler>(new MediaGalleriesCustomBindings())); |
606 module_system->RegisterNativeHandler("page_actions", | 604 module_system->RegisterNativeHandler("page_actions", |
607 scoped_ptr<NativeHandler>( | 605 scoped_ptr<NativeHandler>( |
608 new PageActionsCustomBindings(this))); | 606 new PageActionsCustomBindings(this))); |
609 module_system->RegisterNativeHandler("page_capture", | 607 module_system->RegisterNativeHandler("page_capture", |
610 scoped_ptr<NativeHandler>(new PageCaptureCustomBindings())); | 608 scoped_ptr<NativeHandler>(new PageCaptureCustomBindings())); |
611 module_system->RegisterNativeHandler("runtime", | 609 module_system->RegisterNativeHandler("runtime", |
612 scoped_ptr<NativeHandler>(new RuntimeCustomBindings(context))); | 610 scoped_ptr<NativeHandler>(new RuntimeCustomBindings(context))); |
| 611 module_system->RegisterNativeHandler("sync_file_system", |
| 612 scoped_ptr<NativeHandler>(new SyncFileSystemCustomBindings())); |
613 module_system->RegisterNativeHandler("tabs", | 613 module_system->RegisterNativeHandler("tabs", |
614 scoped_ptr<NativeHandler>(new TabsCustomBindings())); | 614 scoped_ptr<NativeHandler>(new TabsCustomBindings())); |
615 module_system->RegisterNativeHandler("tts", | 615 module_system->RegisterNativeHandler("tts", |
616 scoped_ptr<NativeHandler>(new TTSCustomBindings())); | 616 scoped_ptr<NativeHandler>(new TTSCustomBindings())); |
617 module_system->RegisterNativeHandler("web_request", | 617 module_system->RegisterNativeHandler("web_request", |
618 scoped_ptr<NativeHandler>(new WebRequestCustomBindings())); | 618 scoped_ptr<NativeHandler>(new WebRequestCustomBindings())); |
619 module_system->RegisterNativeHandler("webstore", | 619 module_system->RegisterNativeHandler("webstore", |
620 scoped_ptr<NativeHandler>(new WebstoreBindings(this, context))); | 620 scoped_ptr<NativeHandler>(new WebstoreBindings(this, context))); |
621 } | 621 } |
622 | 622 |
(...skipping 25 matching lines...) Expand all Loading... |
648 source_map_.RegisterSource("browserAction", | 648 source_map_.RegisterSource("browserAction", |
649 IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS); | 649 IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS); |
650 source_map_.RegisterSource("contentSettings", | 650 source_map_.RegisterSource("contentSettings", |
651 IDR_CONTENT_SETTINGS_CUSTOM_BINDINGS_JS); | 651 IDR_CONTENT_SETTINGS_CUSTOM_BINDINGS_JS); |
652 source_map_.RegisterSource("contextMenus", | 652 source_map_.RegisterSource("contextMenus", |
653 IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS); | 653 IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS); |
654 source_map_.RegisterSource("declarativeContent", | 654 source_map_.RegisterSource("declarativeContent", |
655 IDR_DECLARATIVE_CONTENT_CUSTOM_BINDINGS_JS); | 655 IDR_DECLARATIVE_CONTENT_CUSTOM_BINDINGS_JS); |
656 source_map_.RegisterSource("declarativeWebRequest", | 656 source_map_.RegisterSource("declarativeWebRequest", |
657 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS); | 657 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS); |
| 658 source_map_.RegisterSource("downloads", |
| 659 IDR_DOWNLOADS_CUSTOM_BINDINGS_JS); |
658 source_map_.RegisterSource( | 660 source_map_.RegisterSource( |
659 "experimental.mediaGalleries", | 661 "experimental.mediaGalleries", |
660 IDR_EXPERIMENTAL_MEDIA_GALLERIES_CUSTOM_BINDINGS_JS); | 662 IDR_EXPERIMENTAL_MEDIA_GALLERIES_CUSTOM_BINDINGS_JS); |
661 source_map_.RegisterSource("experimental.offscreen", | 663 source_map_.RegisterSource("experimental.offscreen", |
662 IDR_EXPERIMENTAL_OFFSCREENTABS_CUSTOM_BINDINGS_JS); | 664 IDR_EXPERIMENTAL_OFFSCREENTABS_CUSTOM_BINDINGS_JS); |
663 source_map_.RegisterSource("experimental.notification", | 665 source_map_.RegisterSource("experimental.notification", |
664 IDR_NOTIFICATION_CUSTOM_BINDINGS_JS); | 666 IDR_NOTIFICATION_CUSTOM_BINDINGS_JS); |
665 source_map_.RegisterSource("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS); | 667 source_map_.RegisterSource("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS); |
666 source_map_.RegisterSource("fileBrowserHandler", | 668 source_map_.RegisterSource("fileBrowserHandler", |
667 IDR_FILE_BROWSER_HANDLER_CUSTOM_BINDINGS_JS); | 669 IDR_FILE_BROWSER_HANDLER_CUSTOM_BINDINGS_JS); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 1156 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
1155 v8::ThrowException( | 1157 v8::ThrowException( |
1156 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 1158 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
1157 return false; | 1159 return false; |
1158 } | 1160 } |
1159 | 1161 |
1160 return true; | 1162 return true; |
1161 } | 1163 } |
1162 | 1164 |
1163 } // namespace extensions | 1165 } // namespace extensions |
OLD | NEW |