| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #include "content/renderer/web_ui_bindings.h" | 76 #include "content/renderer/web_ui_bindings.h" |
| 77 #include "content/renderer/webplugin_delegate_proxy.h" | 77 #include "content/renderer/webplugin_delegate_proxy.h" |
| 78 #include "content/renderer/websharedworker_proxy.h" | 78 #include "content/renderer/websharedworker_proxy.h" |
| 79 #include "media/base/filter_collection.h" | 79 #include "media/base/filter_collection.h" |
| 80 #include "media/base/media_switches.h" | 80 #include "media/base/media_switches.h" |
| 81 #include "media/base/message_loop_factory_impl.h" | 81 #include "media/base/message_loop_factory_impl.h" |
| 82 #include "net/base/escape.h" | 82 #include "net/base/escape.h" |
| 83 #include "net/base/net_errors.h" | 83 #include "net/base/net_errors.h" |
| 84 #include "net/http/http_util.h" | 84 #include "net/http/http_util.h" |
| 85 #include "ppapi/c/private/ppb_flash_net_connector.h" | 85 #include "ppapi/c/private/ppb_flash_net_connector.h" |
| 86 #include "ppapi/proxy/ppapi_messages.h" |
| 86 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | 87 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" |
| 87 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h" | 88 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h" |
| 88 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
| 89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 90 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 90 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" | 91 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" |
| 91 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 92 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 92 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" | 93 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" |
| 93 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" | 94 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" |
| 94 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 95 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" |
| 95 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement
.h" | 96 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement
.h" |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, | 676 ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, |
| 676 OnGetSerializedHtmlDataForCurrentPageWithLocalLinks) | 677 OnGetSerializedHtmlDataForCurrentPageWithLocalLinks) |
| 677 #if defined(OS_MACOSX) | 678 #if defined(OS_MACOSX) |
| 678 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 679 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
| 679 #endif | 680 #endif |
| 680 IPC_MESSAGE_HANDLER(ViewMsg_ContextMenuClosed, OnContextMenuClosed) | 681 IPC_MESSAGE_HANDLER(ViewMsg_ContextMenuClosed, OnContextMenuClosed) |
| 681 // TODO(viettrungluu): Move to a separate message filter. | 682 // TODO(viettrungluu): Move to a separate message filter. |
| 682 #if defined(ENABLE_FLAPPER_HACKS) | 683 #if defined(ENABLE_FLAPPER_HACKS) |
| 683 IPC_MESSAGE_HANDLER(PepperMsg_ConnectTcpACK, OnConnectTcpACK) | 684 IPC_MESSAGE_HANDLER(PepperMsg_ConnectTcpACK, OnConnectTcpACK) |
| 684 #endif | 685 #endif |
| 686 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, |
| 687 OnTCPSocketConnectACK) |
| 688 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, |
| 689 OnTCPSocketSSLHandshakeACK) |
| 690 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK) |
| 691 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK) |
| 692 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK) |
| 693 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_RecvFromACK, |
| 694 OnUDPSocketRecvFromACK) |
| 695 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_SendToACK, OnUDPSocketSendToACK) |
| 685 #if defined(OS_MACOSX) | 696 #if defined(OS_MACOSX) |
| 686 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) | 697 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) |
| 687 #endif | 698 #endif |
| 688 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, | 699 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, |
| 689 OnSetHistoryLengthAndPrune) | 700 OnSetHistoryLengthAndPrune) |
| 690 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 701 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| 691 IPC_MESSAGE_HANDLER(ViewMsg_LockMouse_ACK, OnLockMouseACK) | 702 IPC_MESSAGE_HANDLER(ViewMsg_LockMouse_ACK, OnLockMouseACK) |
| 692 IPC_MESSAGE_HANDLER(ViewMsg_MouseLockLost, OnMouseLockLost) | 703 IPC_MESSAGE_HANDLER(ViewMsg_MouseLockLost, OnMouseLockLost) |
| 693 IPC_MESSAGE_HANDLER(JavaBridgeMsg_Init, OnJavaBridgeInit) | 704 IPC_MESSAGE_HANDLER(JavaBridgeMsg_Init, OnJavaBridgeInit) |
| 694 | 705 |
| (...skipping 3990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4685 const PP_NetAddress_Private& local_addr, | 4696 const PP_NetAddress_Private& local_addr, |
| 4686 const PP_NetAddress_Private& remote_addr) { | 4697 const PP_NetAddress_Private& remote_addr) { |
| 4687 pepper_delegate_.OnConnectTcpACK( | 4698 pepper_delegate_.OnConnectTcpACK( |
| 4688 request_id, | 4699 request_id, |
| 4689 IPC::PlatformFileForTransitToPlatformFile(socket_for_transit), | 4700 IPC::PlatformFileForTransitToPlatformFile(socket_for_transit), |
| 4690 local_addr, | 4701 local_addr, |
| 4691 remote_addr); | 4702 remote_addr); |
| 4692 } | 4703 } |
| 4693 #endif | 4704 #endif |
| 4694 | 4705 |
| 4706 void RenderViewImpl::OnTCPSocketConnectACK( |
| 4707 uint32 /* plugin_dispatcher_id */, |
| 4708 uint32 socket_id, |
| 4709 bool succeeded, |
| 4710 const PP_NetAddress_Private& local_addr, |
| 4711 const PP_NetAddress_Private& remote_addr) { |
| 4712 pepper_delegate_.OnTCPSocketConnectACK( |
| 4713 socket_id, succeeded, local_addr, remote_addr); |
| 4714 } |
| 4715 |
| 4716 void RenderViewImpl::OnTCPSocketSSLHandshakeACK( |
| 4717 uint32 /* plugin_dispatcher_id */, |
| 4718 uint32 socket_id, |
| 4719 bool succeeded) { |
| 4720 pepper_delegate_.OnTCPSocketSSLHandshakeACK(socket_id, succeeded); |
| 4721 } |
| 4722 |
| 4723 void RenderViewImpl::OnTCPSocketReadACK(uint32 /* plugin_dispatcher_id */, |
| 4724 uint32 socket_id, |
| 4725 bool succeeded, |
| 4726 const std::string& data) { |
| 4727 pepper_delegate_.OnTCPSocketReadACK(socket_id, succeeded, data); |
| 4728 } |
| 4729 |
| 4730 void RenderViewImpl::OnTCPSocketWriteACK(uint32 /* plugin_dispatcher_id */, |
| 4731 uint32 socket_id, |
| 4732 bool succeeded, |
| 4733 int32_t bytes_written) { |
| 4734 pepper_delegate_.OnTCPSocketWriteACK(socket_id, succeeded, bytes_written); |
| 4735 } |
| 4736 |
| 4737 void RenderViewImpl::OnUDPSocketBindACK(uint32 /* plugin_dispatcher_id */, |
| 4738 uint32 socket_id, |
| 4739 bool succeeded) { |
| 4740 pepper_delegate_.OnUDPSocketBindACK(socket_id, succeeded); |
| 4741 } |
| 4742 |
| 4743 void RenderViewImpl::OnUDPSocketRecvFromACK( |
| 4744 uint32 /* plugin_dispatcher_id */, |
| 4745 uint32 socket_id, |
| 4746 bool succeeded, |
| 4747 const std::string& data, |
| 4748 const PP_NetAddress_Private& remote_addr) { |
| 4749 pepper_delegate_.OnUDPSocketRecvFromACK(socket_id, |
| 4750 succeeded, |
| 4751 data, |
| 4752 remote_addr); |
| 4753 } |
| 4754 |
| 4755 void RenderViewImpl::OnUDPSocketSendToACK(uint32 /* plugin_dispatcher_id */, |
| 4756 uint32 socket_id, |
| 4757 bool succeeded, |
| 4758 int32_t bytes_written) { |
| 4759 pepper_delegate_.OnUDPSocketSendToACK(socket_id, succeeded, bytes_written); |
| 4760 } |
| 4761 |
| 4695 void RenderViewImpl::OnContextMenuClosed( | 4762 void RenderViewImpl::OnContextMenuClosed( |
| 4696 const webkit_glue::CustomContextMenuContext& custom_context) { | 4763 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4697 if (custom_context.is_pepper_menu) | 4764 if (custom_context.is_pepper_menu) |
| 4698 pepper_delegate_.OnContextMenuClosed(custom_context); | 4765 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4699 else | 4766 else |
| 4700 context_menu_node_.reset(); | 4767 context_menu_node_.reset(); |
| 4701 } | 4768 } |
| 4702 | 4769 |
| 4703 void RenderViewImpl::OnEnableViewSourceMode() { | 4770 void RenderViewImpl::OnEnableViewSourceMode() { |
| 4704 if (!webview()) | 4771 if (!webview()) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 4730 return !!RenderThreadImpl::current()->compositor_thread(); | 4797 return !!RenderThreadImpl::current()->compositor_thread(); |
| 4731 } | 4798 } |
| 4732 | 4799 |
| 4733 void RenderViewImpl::OnJavaBridgeInit( | 4800 void RenderViewImpl::OnJavaBridgeInit( |
| 4734 const IPC::ChannelHandle& channel_handle) { | 4801 const IPC::ChannelHandle& channel_handle) { |
| 4735 DCHECK(!java_bridge_dispatcher_.get()); | 4802 DCHECK(!java_bridge_dispatcher_.get()); |
| 4736 #if defined(ENABLE_JAVA_BRIDGE) | 4803 #if defined(ENABLE_JAVA_BRIDGE) |
| 4737 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4804 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
| 4738 #endif | 4805 #endif |
| 4739 } | 4806 } |
| OLD | NEW |