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/browser/frame_host/cross_process_frame_connector.h" | 5 #include "content/browser/frame_host/cross_process_frame_connector.h" |
6 | 6 |
7 #include "content/browser/frame_host/render_frame_host_impl.h" | 7 #include "content/browser/frame_host/render_frame_host_impl.h" |
8 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 8 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
10 #include "content/browser/renderer_host/render_widget_host_impl.h" | 10 #include "content/browser/renderer_host/render_widget_host_impl.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 frame_proxy_in_parent_renderer->set_cross_process_frame_connector(this); | 22 frame_proxy_in_parent_renderer->set_cross_process_frame_connector(this); |
23 } | 23 } |
24 | 24 |
25 CrossProcessFrameConnector::~CrossProcessFrameConnector() { | 25 CrossProcessFrameConnector::~CrossProcessFrameConnector() { |
26 if (view_) | 26 if (view_) |
27 view_->set_cross_process_frame_connector(NULL); | 27 view_->set_cross_process_frame_connector(NULL); |
28 } | 28 } |
29 | 29 |
30 bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { | 30 bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { |
31 bool handled = true; | 31 bool handled = true; |
32 bool msg_is_ok = true; | |
33 | 32 |
34 IPC_BEGIN_MESSAGE_MAP_EX(CrossProcessFrameConnector, msg, msg_is_ok) | 33 IPC_BEGIN_MESSAGE_MAP(CrossProcessFrameConnector, msg) |
35 IPC_MESSAGE_HANDLER(FrameHostMsg_BuffersSwappedACK, OnBuffersSwappedACK) | 34 IPC_MESSAGE_HANDLER(FrameHostMsg_BuffersSwappedACK, OnBuffersSwappedACK) |
36 IPC_MESSAGE_HANDLER(FrameHostMsg_CompositorFrameSwappedACK, | 35 IPC_MESSAGE_HANDLER(FrameHostMsg_CompositorFrameSwappedACK, |
37 OnCompositorFrameSwappedACK) | 36 OnCompositorFrameSwappedACK) |
38 IPC_MESSAGE_HANDLER(FrameHostMsg_ReclaimCompositorResources, | 37 IPC_MESSAGE_HANDLER(FrameHostMsg_ReclaimCompositorResources, |
39 OnReclaimCompositorResources) | 38 OnReclaimCompositorResources) |
40 IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent) | 39 IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent) |
41 IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame, | 40 IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame, |
42 OnInitializeChildFrame) | 41 OnInitializeChildFrame) |
43 IPC_MESSAGE_UNHANDLED(handled = false) | 42 IPC_MESSAGE_UNHANDLED(handled = false) |
44 IPC_END_MESSAGE_MAP_EX() | 43 IPC_END_MESSAGE_MAP() |
45 | 44 |
46 return handled; | 45 return handled; |
47 } | 46 } |
48 | 47 |
49 void CrossProcessFrameConnector::set_view( | 48 void CrossProcessFrameConnector::set_view( |
50 RenderWidgetHostViewChildFrame* view) { | 49 RenderWidgetHostViewChildFrame* view) { |
51 // Detach ourselves from the previous |view_|. | 50 // Detach ourselves from the previous |view_|. |
52 if (view_) | 51 if (view_) |
53 view_->set_cross_process_frame_connector(NULL); | 52 view_->set_cross_process_frame_connector(NULL); |
54 | 53 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 169 } |
171 | 170 |
172 if (event->type == blink::WebInputEvent::MouseWheel) { | 171 if (event->type == blink::WebInputEvent::MouseWheel) { |
173 child_widget->ForwardWheelEvent( | 172 child_widget->ForwardWheelEvent( |
174 *static_cast<const blink::WebMouseWheelEvent*>(event)); | 173 *static_cast<const blink::WebMouseWheelEvent*>(event)); |
175 return; | 174 return; |
176 } | 175 } |
177 } | 176 } |
178 | 177 |
179 } // namespace content | 178 } // namespace content |
OLD | NEW |