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/debug/alias.h" | 9 #include "base/debug/alias.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 92 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
93 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 93 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
94 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 94 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
95 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 95 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
96 #include "third_party/WebKit/public/web/WebView.h" | 96 #include "third_party/WebKit/public/web/WebView.h" |
97 #include "ui/base/layout.h" | 97 #include "ui/base/layout.h" |
98 #include "ui/base/resource/resource_bundle.h" | 98 #include "ui/base/resource/resource_bundle.h" |
99 #include "v8/include/v8.h" | 99 #include "v8/include/v8.h" |
100 | 100 |
101 #if defined(ENABLE_WEBRTC) | 101 #if defined(ENABLE_WEBRTC) |
102 #include "chrome/renderer/extensions/webrtc_native_handler.h" | 102 #include "chrome/renderer/extensions/cast_streaming_native_handler.h" |
103 #endif | 103 #endif |
104 | 104 |
105 using blink::WebDataSource; | 105 using blink::WebDataSource; |
106 using blink::WebDocument; | 106 using blink::WebDocument; |
107 using blink::WebFrame; | 107 using blink::WebFrame; |
108 using blink::WebScopedUserGesture; | 108 using blink::WebScopedUserGesture; |
109 using blink::WebSecurityPolicy; | 109 using blink::WebSecurityPolicy; |
110 using blink::WebString; | 110 using blink::WebString; |
111 using blink::WebVector; | 111 using blink::WebVector; |
112 using blink::WebView; | 112 using blink::WebView; |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 module_system->RegisterNativeHandler("page_capture", | 937 module_system->RegisterNativeHandler("page_capture", |
938 scoped_ptr<NativeHandler>( | 938 scoped_ptr<NativeHandler>( |
939 new PageCaptureCustomBindings(this, context))); | 939 new PageCaptureCustomBindings(this, context))); |
940 module_system->RegisterNativeHandler("runtime", | 940 module_system->RegisterNativeHandler("runtime", |
941 scoped_ptr<NativeHandler>(new RuntimeCustomBindings(this, context))); | 941 scoped_ptr<NativeHandler>(new RuntimeCustomBindings(this, context))); |
942 module_system->RegisterNativeHandler("tabs", | 942 module_system->RegisterNativeHandler("tabs", |
943 scoped_ptr<NativeHandler>(new TabsCustomBindings(this, context))); | 943 scoped_ptr<NativeHandler>(new TabsCustomBindings(this, context))); |
944 module_system->RegisterNativeHandler("webstore", | 944 module_system->RegisterNativeHandler("webstore", |
945 scoped_ptr<NativeHandler>(new WebstoreBindings(this, context))); | 945 scoped_ptr<NativeHandler>(new WebstoreBindings(this, context))); |
946 #if defined(ENABLE_WEBRTC) | 946 #if defined(ENABLE_WEBRTC) |
947 module_system->RegisterNativeHandler("webrtc_natives", | 947 module_system->RegisterNativeHandler("cast_streaming_natives", |
948 scoped_ptr<NativeHandler>(new WebRtcNativeHandler(context))); | 948 scoped_ptr<NativeHandler>(new CastStreamingNativeHandler(context))); |
949 #endif | 949 #endif |
950 } | 950 } |
951 | 951 |
952 void Dispatcher::PopulateSourceMap() { | 952 void Dispatcher::PopulateSourceMap() { |
953 // Libraries. | 953 // Libraries. |
954 source_map_.RegisterSource("entryIdManager", IDR_ENTRY_ID_MANAGER); | 954 source_map_.RegisterSource("entryIdManager", IDR_ENTRY_ID_MANAGER); |
955 source_map_.RegisterSource(kEventBindings, IDR_EVENT_BINDINGS_JS); | 955 source_map_.RegisterSource(kEventBindings, IDR_EVENT_BINDINGS_JS); |
956 source_map_.RegisterSource("imageUtil", IDR_IMAGE_UTIL_JS); | 956 source_map_.RegisterSource("imageUtil", IDR_IMAGE_UTIL_JS); |
957 source_map_.RegisterSource("json_schema", IDR_JSON_SCHEMA_JS); | 957 source_map_.RegisterSource("json_schema", IDR_JSON_SCHEMA_JS); |
958 source_map_.RegisterSource("lastError", IDR_LAST_ERROR_JS); | 958 source_map_.RegisterSource("lastError", IDR_LAST_ERROR_JS); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 source_map_.RegisterSource("systemIndicator", | 1017 source_map_.RegisterSource("systemIndicator", |
1018 IDR_SYSTEM_INDICATOR_CUSTOM_BINDINGS_JS); | 1018 IDR_SYSTEM_INDICATOR_CUSTOM_BINDINGS_JS); |
1019 source_map_.RegisterSource("tabCapture", IDR_TAB_CAPTURE_CUSTOM_BINDINGS_JS); | 1019 source_map_.RegisterSource("tabCapture", IDR_TAB_CAPTURE_CUSTOM_BINDINGS_JS); |
1020 source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); | 1020 source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); |
1021 source_map_.RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); | 1021 source_map_.RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); |
1022 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); | 1022 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); |
1023 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); | 1023 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); |
1024 source_map_.RegisterSource("webRequestInternal", | 1024 source_map_.RegisterSource("webRequestInternal", |
1025 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); | 1025 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); |
1026 #if defined(ENABLE_WEBRTC) | 1026 #if defined(ENABLE_WEBRTC) |
| 1027 source_map_.RegisterSource("cast.streaming.rtpStream", |
| 1028 IDR_CAST_STREAMING_RTP_STREAM_CUSTOM_BINDINGS_JS); |
1027 source_map_.RegisterSource("cast.streaming.session", | 1029 source_map_.RegisterSource("cast.streaming.session", |
1028 IDR_CAST_STREAMING_SESSION_CUSTOM_BINDINGS_JS); | 1030 IDR_CAST_STREAMING_SESSION_CUSTOM_BINDINGS_JS); |
1029 source_map_.RegisterSource("webrtc.castSendTransport", | 1031 source_map_.RegisterSource( |
1030 IDR_WEBRTC_CAST_SEND_TRANSPORT_CUSTOM_BINDINGS_JS); | 1032 "cast.streaming.udpTransport", |
1031 source_map_.RegisterSource("webrtc.castUdpTransport", | 1033 IDR_CAST_STREAMING_UDP_TRANSPORT_CUSTOM_BINDINGS_JS); |
1032 IDR_WEBRTC_CAST_UDP_TRANSPORT_CUSTOM_BINDINGS_JS); | |
1033 #endif | 1034 #endif |
1034 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); | 1035 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); |
1035 source_map_.RegisterSource("windowControls", IDR_WINDOW_CONTROLS_JS); | 1036 source_map_.RegisterSource("windowControls", IDR_WINDOW_CONTROLS_JS); |
1036 source_map_.RegisterSource("binding", IDR_BINDING_JS); | 1037 source_map_.RegisterSource("binding", IDR_BINDING_JS); |
1037 | 1038 |
1038 // Custom types sources. | 1039 // Custom types sources. |
1039 source_map_.RegisterSource("ChromeSetting", IDR_CHROME_SETTING_JS); | 1040 source_map_.RegisterSource("ChromeSetting", IDR_CHROME_SETTING_JS); |
1040 source_map_.RegisterSource("StorageArea", IDR_STORAGE_AREA_JS); | 1041 source_map_.RegisterSource("StorageArea", IDR_STORAGE_AREA_JS); |
1041 source_map_.RegisterSource("ContentSetting", IDR_CONTENT_SETTING_JS); | 1042 source_map_.RegisterSource("ContentSetting", IDR_CONTENT_SETTING_JS); |
1042 source_map_.RegisterSource("ChromeDirectSetting", | 1043 source_map_.RegisterSource("ChromeDirectSetting", |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 RenderView* background_view = | 1647 RenderView* background_view = |
1647 ExtensionHelper::GetBackgroundPage(extension_id); | 1648 ExtensionHelper::GetBackgroundPage(extension_id); |
1648 if (background_view) { | 1649 if (background_view) { |
1649 background_view->Send(new ExtensionHostMsg_EventAck( | 1650 background_view->Send(new ExtensionHostMsg_EventAck( |
1650 background_view->GetRoutingID())); | 1651 background_view->GetRoutingID())); |
1651 } | 1652 } |
1652 } | 1653 } |
1653 } | 1654 } |
1654 | 1655 |
1655 } // namespace extensions | 1656 } // namespace extensions |
OLD | NEW |