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/notification_service.h" | 36 #include "content/common/notification_service.h" |
36 #include "content/common/pepper_messages.h" | 37 #include "content/common/pepper_messages.h" |
37 #include "content/common/pepper_plugin_registry.h" | 38 #include "content/common/pepper_plugin_registry.h" |
38 #include "content/common/quota_dispatcher.h" | 39 #include "content/common/quota_dispatcher.h" |
39 #include "content/common/renderer_preferences.h" | 40 #include "content/common/renderer_preferences.h" |
40 #include "content/common/request_extra_data.h" | 41 #include "content/common/request_extra_data.h" |
41 #include "content/common/view_messages.h" | 42 #include "content/common/view_messages.h" |
42 #include "content/public/common/bindings_policy.h" | 43 #include "content/public/common/bindings_policy.h" |
43 #include "content/public/common/content_switches.h" | 44 #include "content/public/common/content_switches.h" |
44 #include "content/public/common/url_constants.h" | 45 #include "content/public/common/url_constants.h" |
45 #include "content/public/renderer/content_renderer_client.h" | 46 #include "content/public/renderer/content_renderer_client.h" |
46 #include "content/public/renderer/navigation_state.h" | 47 #include "content/public/renderer/navigation_state.h" |
47 #include "content/public/renderer/render_view_observer.h" | 48 #include "content/public/renderer/render_view_observer.h" |
48 #include "content/public/renderer/render_view_visitor.h" | 49 #include "content/public/renderer/render_view_visitor.h" |
49 #include "content/renderer/device_orientation_dispatcher.h" | 50 #include "content/renderer/device_orientation_dispatcher.h" |
50 #include "content/renderer/devtools_agent.h" | 51 #include "content/renderer/devtools_agent.h" |
51 #include "content/renderer/external_popup_menu.h" | 52 #include "content/renderer/external_popup_menu.h" |
52 #include "content/renderer/geolocation_dispatcher.h" | 53 #include "content/renderer/geolocation_dispatcher.h" |
53 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 54 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
54 #include "content/renderer/intents_dispatcher.h" | 55 #include "content/renderer/intents_dispatcher.h" |
| 56 #include "content/renderer/java_bridge_dispatcher.h" |
55 #include "content/renderer/load_progress_tracker.h" | 57 #include "content/renderer/load_progress_tracker.h" |
56 #include "content/renderer/media/audio_message_filter.h" | 58 #include "content/renderer/media/audio_message_filter.h" |
57 #include "content/renderer/media/audio_renderer_impl.h" | 59 #include "content/renderer/media/audio_renderer_impl.h" |
58 #include "content/renderer/media/media_stream_impl.h" | 60 #include "content/renderer/media/media_stream_impl.h" |
59 #include "content/renderer/media/render_media_log.h" | 61 #include "content/renderer/media/render_media_log.h" |
60 #include "content/renderer/mhtml_generator.h" | 62 #include "content/renderer/mhtml_generator.h" |
61 #include "content/renderer/notification_provider.h" | 63 #include "content/renderer/notification_provider.h" |
62 #include "content/renderer/p2p/socket_dispatcher.h" | 64 #include "content/renderer/p2p/socket_dispatcher.h" |
63 #include "content/renderer/plugin_channel_host.h" | 65 #include "content/renderer/plugin_channel_host.h" |
64 #include "content/renderer/render_process.h" | 66 #include "content/renderer/render_process.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 #if defined(OS_MACOSX) | 667 #if defined(OS_MACOSX) |
666 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) | 668 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) |
667 #endif | 669 #endif |
668 IPC_MESSAGE_HANDLER(ViewMsg_UpdateRemoteAccessClientFirewallTraversal, | 670 IPC_MESSAGE_HANDLER(ViewMsg_UpdateRemoteAccessClientFirewallTraversal, |
669 OnUpdateRemoteAccessClientFirewallTraversal) | 671 OnUpdateRemoteAccessClientFirewallTraversal) |
670 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, | 672 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, |
671 OnSetHistoryLengthAndPrune) | 673 OnSetHistoryLengthAndPrune) |
672 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 674 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
673 IPC_MESSAGE_HANDLER(ViewMsg_LockMouse_ACK, OnLockMouseACK) | 675 IPC_MESSAGE_HANDLER(ViewMsg_LockMouse_ACK, OnLockMouseACK) |
674 IPC_MESSAGE_HANDLER(ViewMsg_MouseLockLost, OnMouseLockLost) | 676 IPC_MESSAGE_HANDLER(ViewMsg_MouseLockLost, OnMouseLockLost) |
| 677 IPC_MESSAGE_HANDLER(ViewMsg_JavaBridgeInit, OnJavaBridgeInit) |
675 | 678 |
676 // Have the super handle all other messages. | 679 // Have the super handle all other messages. |
677 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) | 680 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) |
678 IPC_END_MESSAGE_MAP() | 681 IPC_END_MESSAGE_MAP() |
679 | 682 |
680 if (!msg_is_ok) { | 683 if (!msg_is_ok) { |
681 // The message had a handler, but its deserialization failed. | 684 // The message had a handler, but its deserialization failed. |
682 // Kill the renderer to avoid potential spoofing attacks. | 685 // Kill the renderer to avoid potential spoofing attacks. |
683 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; | 686 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; |
684 } | 687 } |
(...skipping 3934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 pepper_delegate_.OnLockMouseACK(succeeded); | 4622 pepper_delegate_.OnLockMouseACK(succeeded); |
4620 } | 4623 } |
4621 | 4624 |
4622 void RenderViewImpl::OnMouseLockLost() { | 4625 void RenderViewImpl::OnMouseLockLost() { |
4623 pepper_delegate_.OnMouseLockLost(); | 4626 pepper_delegate_.OnMouseLockLost(); |
4624 } | 4627 } |
4625 | 4628 |
4626 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4629 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4627 return webview()->settings()->useThreadedCompositor(); | 4630 return webview()->settings()->useThreadedCompositor(); |
4628 } | 4631 } |
| 4632 |
| 4633 void RenderViewImpl::OnJavaBridgeInit( |
| 4634 const IPC::ChannelHandle& channel_handle) { |
| 4635 DCHECK(!java_bridge_dispatcher_.get()); |
| 4636 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
| 4637 } |
OLD | NEW |