| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_frame_proxy.h" | 5 #include "content/renderer/render_frame_proxy.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "content/child/webmessageportchannel_impl.h" | 10 #include "content/child/webmessageportchannel_impl.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) { | 178 bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) { |
| 179 bool handled = true; | 179 bool handled = true; |
| 180 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxy, msg) | 180 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxy, msg) |
| 181 IPC_MESSAGE_HANDLER(FrameMsg_DeleteProxy, OnDeleteProxy) | 181 IPC_MESSAGE_HANDLER(FrameMsg_DeleteProxy, OnDeleteProxy) |
| 182 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) | 182 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) |
| 183 IPC_MESSAGE_HANDLER_GENERIC(FrameMsg_CompositorFrameSwapped, | 183 IPC_MESSAGE_HANDLER_GENERIC(FrameMsg_CompositorFrameSwapped, |
| 184 OnCompositorFrameSwapped(msg)) | 184 OnCompositorFrameSwapped(msg)) |
| 185 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) | 185 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) |
| 186 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) | 186 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) |
| 187 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) | 187 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) |
| 188 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) |
| 188 IPC_MESSAGE_UNHANDLED(handled = false) | 189 IPC_MESSAGE_UNHANDLED(handled = false) |
| 189 IPC_END_MESSAGE_MAP() | 190 IPC_END_MESSAGE_MAP() |
| 190 | 191 |
| 191 // Note: If |handled| is true, |this| may have been deleted. | 192 // Note: If |handled| is true, |this| may have been deleted. |
| 192 return handled; | 193 return handled; |
| 193 } | 194 } |
| 194 | 195 |
| 195 bool RenderFrameProxy::Send(IPC::Message* message) { | 196 bool RenderFrameProxy::Send(IPC::Message* message) { |
| 196 return RenderThread::Get()->Send(message); | 197 return RenderThread::Get()->Send(message); |
| 197 } | 198 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 web_frame_->didStartLoading(); | 256 web_frame_->didStartLoading(); |
| 256 } | 257 } |
| 257 | 258 |
| 258 void RenderFrameProxy::OnDidStopLoading() { | 259 void RenderFrameProxy::OnDidStopLoading() { |
| 259 if (IsMainFrameDetachedFromTree()) | 260 if (IsMainFrameDetachedFromTree()) |
| 260 return; | 261 return; |
| 261 | 262 |
| 262 web_frame_->didStopLoading(); | 263 web_frame_->didStopLoading(); |
| 263 } | 264 } |
| 264 | 265 |
| 266 void RenderFrameProxy::OnDispatchLoad() { |
| 267 web_frame_->DispatchLoadEventForFrameOwner(); |
| 268 } |
| 269 |
| 265 void RenderFrameProxy::frameDetached() { | 270 void RenderFrameProxy::frameDetached() { |
| 266 if (web_frame_->parent()) | 271 if (web_frame_->parent()) |
| 267 web_frame_->parent()->removeChild(web_frame_); | 272 web_frame_->parent()->removeChild(web_frame_); |
| 268 | 273 |
| 269 web_frame_->close(); | 274 web_frame_->close(); |
| 270 delete this; | 275 delete this; |
| 271 } | 276 } |
| 272 | 277 |
| 273 void RenderFrameProxy::postMessageEvent( | 278 void RenderFrameProxy::postMessageEvent( |
| 274 blink::WebLocalFrame* source_frame, | 279 blink::WebLocalFrame* source_frame, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 blink::WebUserGestureIndicator::isProcessingUserGesture(); | 337 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 333 blink::WebUserGestureIndicator::consumeUserGesture(); | 338 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 334 Send(new FrameHostMsg_OpenURL(routing_id_, params)); | 339 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 335 } | 340 } |
| 336 | 341 |
| 337 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { | 342 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { |
| 338 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); | 343 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); |
| 339 } | 344 } |
| 340 | 345 |
| 341 } // namespace | 346 } // namespace |
| OLD | NEW |