OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "base/time.h" | 25 #include "base/time.h" |
26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
27 #include "content/common/appcache/appcache_dispatcher.h" | 27 #include "content/common/appcache/appcache_dispatcher.h" |
28 #include "content/common/clipboard_messages.h" | 28 #include "content/common/clipboard_messages.h" |
29 #include "content/common/content_constants.h" | 29 #include "content/common/content_constants.h" |
30 #include "content/common/database_messages.h" | 30 #include "content/common/database_messages.h" |
31 #include "content/common/drag_messages.h" | 31 #include "content/common/drag_messages.h" |
32 #include "content/common/file_system/file_system_dispatcher.h" | 32 #include "content/common/file_system/file_system_dispatcher.h" |
33 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" | 33 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" |
34 #include "content/common/intents_messages.h" | 34 #include "content/common/intents_messages.h" |
| 35 #include "content/common/java_bridge_messages.h" |
35 #include "content/common/pepper_messages.h" | 36 #include "content/common/pepper_messages.h" |
36 #include "content/common/pepper_plugin_registry.h" | 37 #include "content/common/pepper_plugin_registry.h" |
37 #include "content/common/quota_dispatcher.h" | 38 #include "content/common/quota_dispatcher.h" |
38 #include "content/common/renderer_preferences.h" | 39 #include "content/common/renderer_preferences.h" |
39 #include "content/common/request_extra_data.h" | 40 #include "content/common/request_extra_data.h" |
40 #include "content/common/view_messages.h" | 41 #include "content/common/view_messages.h" |
41 #include "content/public/common/bindings_policy.h" | 42 #include "content/public/common/bindings_policy.h" |
42 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
43 #include "content/public/common/url_constants.h" | 44 #include "content/public/common/url_constants.h" |
44 #include "content/public/renderer/content_renderer_client.h" | 45 #include "content/public/renderer/content_renderer_client.h" |
45 #include "content/public/renderer/navigation_state.h" | 46 #include "content/public/renderer/navigation_state.h" |
46 #include "content/public/renderer/render_view_observer.h" | 47 #include "content/public/renderer/render_view_observer.h" |
47 #include "content/public/renderer/render_view_visitor.h" | 48 #include "content/public/renderer/render_view_visitor.h" |
48 #include "content/renderer/device_orientation_dispatcher.h" | 49 #include "content/renderer/device_orientation_dispatcher.h" |
49 #include "content/renderer/devtools_agent.h" | 50 #include "content/renderer/devtools_agent.h" |
50 #include "content/renderer/external_popup_menu.h" | 51 #include "content/renderer/external_popup_menu.h" |
51 #include "content/renderer/geolocation_dispatcher.h" | 52 #include "content/renderer/geolocation_dispatcher.h" |
52 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 53 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
53 #include "content/renderer/intents_dispatcher.h" | 54 #include "content/renderer/intents_dispatcher.h" |
| 55 #include "content/renderer/java_bridge_dispatcher.h" |
54 #include "content/renderer/load_progress_tracker.h" | 56 #include "content/renderer/load_progress_tracker.h" |
55 #include "content/renderer/media/audio_message_filter.h" | 57 #include "content/renderer/media/audio_message_filter.h" |
56 #include "content/renderer/media/audio_renderer_impl.h" | 58 #include "content/renderer/media/audio_renderer_impl.h" |
57 #include "content/renderer/media/media_stream_impl.h" | 59 #include "content/renderer/media/media_stream_impl.h" |
58 #include "content/renderer/media/render_media_log.h" | 60 #include "content/renderer/media/render_media_log.h" |
59 #include "content/renderer/mhtml_generator.h" | 61 #include "content/renderer/mhtml_generator.h" |
60 #include "content/renderer/notification_provider.h" | 62 #include "content/renderer/notification_provider.h" |
61 #include "content/renderer/p2p/socket_dispatcher.h" | 63 #include "content/renderer/p2p/socket_dispatcher.h" |
62 #include "content/renderer/plugin_channel_host.h" | 64 #include "content/renderer/plugin_channel_host.h" |
63 #include "content/renderer/render_process.h" | 65 #include "content/renderer/render_process.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 #if defined(OS_MACOSX) | 666 #if defined(OS_MACOSX) |
665 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) | 667 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) |
666 #endif | 668 #endif |
667 IPC_MESSAGE_HANDLER(ViewMsg_UpdateRemoteAccessClientFirewallTraversal, | 669 IPC_MESSAGE_HANDLER(ViewMsg_UpdateRemoteAccessClientFirewallTraversal, |
668 OnUpdateRemoteAccessClientFirewallTraversal) | 670 OnUpdateRemoteAccessClientFirewallTraversal) |
669 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, | 671 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, |
670 OnSetHistoryLengthAndPrune) | 672 OnSetHistoryLengthAndPrune) |
671 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 673 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
672 IPC_MESSAGE_HANDLER(ViewMsg_LockMouse_ACK, OnLockMouseACK) | 674 IPC_MESSAGE_HANDLER(ViewMsg_LockMouse_ACK, OnLockMouseACK) |
673 IPC_MESSAGE_HANDLER(ViewMsg_MouseLockLost, OnMouseLockLost) | 675 IPC_MESSAGE_HANDLER(ViewMsg_MouseLockLost, OnMouseLockLost) |
| 676 IPC_MESSAGE_HANDLER(JavaBridgeMsg_Init, OnJavaBridgeInit) |
674 | 677 |
675 // Have the super handle all other messages. | 678 // Have the super handle all other messages. |
676 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) | 679 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) |
677 IPC_END_MESSAGE_MAP() | 680 IPC_END_MESSAGE_MAP() |
678 | 681 |
679 if (!msg_is_ok) { | 682 if (!msg_is_ok) { |
680 // The message had a handler, but its deserialization failed. | 683 // The message had a handler, but its deserialization failed. |
681 // Kill the renderer to avoid potential spoofing attacks. | 684 // Kill the renderer to avoid potential spoofing attacks. |
682 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; | 685 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; |
683 } | 686 } |
(...skipping 3955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4639 pepper_delegate_.OnLockMouseACK(succeeded); | 4642 pepper_delegate_.OnLockMouseACK(succeeded); |
4640 } | 4643 } |
4641 | 4644 |
4642 void RenderViewImpl::OnMouseLockLost() { | 4645 void RenderViewImpl::OnMouseLockLost() { |
4643 pepper_delegate_.OnMouseLockLost(); | 4646 pepper_delegate_.OnMouseLockLost(); |
4644 } | 4647 } |
4645 | 4648 |
4646 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4649 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4647 return webview()->settings()->useThreadedCompositor(); | 4650 return webview()->settings()->useThreadedCompositor(); |
4648 } | 4651 } |
| 4652 |
| 4653 void RenderViewImpl::OnJavaBridgeInit( |
| 4654 const IPC::ChannelHandle& channel_handle) { |
| 4655 DCHECK(!java_bridge_dispatcher_.get()); |
| 4656 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
| 4657 } |
OLD | NEW |