Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Side by Side Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 1382593004: Allow out-of-process iframes to update the mouse cursor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits addressed Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "cc/surfaces/surface.h" 7 #include "cc/surfaces/surface.h"
8 #include "cc/surfaces/surface_manager.h" 8 #include "cc/surfaces/surface_manager.h"
9 #include "content/browser/compositor/surface_utils.h" 9 #include "content/browser/compositor/surface_utils.h"
10 #include "content/browser/frame_host/frame_tree.h"
10 #include "content/browser/frame_host/frame_tree_node.h" 11 #include "content/browser/frame_host/frame_tree_node.h"
11 #include "content/browser/frame_host/render_frame_host_manager.h" 12 #include "content/browser/frame_host/render_frame_host_manager.h"
12 #include "content/browser/frame_host/render_frame_proxy_host.h" 13 #include "content/browser/frame_host/render_frame_proxy_host.h"
13 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 14 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
14 #include "content/browser/renderer_host/render_view_host_impl.h" 15 #include "content/browser/renderer_host/render_view_host_impl.h"
15 #include "content/browser/renderer_host/render_widget_host_impl.h" 16 #include "content/browser/renderer_host/render_widget_host_impl.h"
16 #include "content/browser/renderer_host/render_widget_host_view_base.h" 17 #include "content/browser/renderer_host/render_widget_host_view_base.h"
17 #include "content/common/frame_messages.h" 18 #include "content/common/frame_messages.h"
18 #include "content/common/gpu/gpu_messages.h" 19 #include "content/common/gpu/gpu_messages.h"
19 #include "third_party/WebKit/public/web/WebInputEvent.h" 20 #include "third_party/WebKit/public/web/WebInputEvent.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 DCHECK(frame_proxy_in_parent_renderer_->frame_tree_node()->IsMainFrame()); 157 DCHECK(frame_proxy_in_parent_renderer_->frame_tree_node()->IsMainFrame());
157 return; 158 return;
158 } 159 }
159 160
160 RenderWidgetHostView* rwhv = 161 RenderWidgetHostView* rwhv =
161 frame_proxy_in_parent_renderer_->GetRenderWidgetHostView(); 162 frame_proxy_in_parent_renderer_->GetRenderWidgetHostView();
162 if (rwhv) 163 if (rwhv)
163 static_cast<RenderWidgetHostViewBase*>(rwhv)->GetScreenInfo(results); 164 static_cast<RenderWidgetHostViewBase*>(rwhv)->GetScreenInfo(results);
164 } 165 }
165 166
167 void CrossProcessFrameConnector::UpdateCursor(const WebCursor& cursor) {
168 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView();
169 if (root_view)
170 root_view->UpdateCursor(cursor);
171 }
172
166 void CrossProcessFrameConnector::OnForwardInputEvent( 173 void CrossProcessFrameConnector::OnForwardInputEvent(
167 const blink::WebInputEvent* event) { 174 const blink::WebInputEvent* event) {
168 if (!view_) 175 if (!view_)
169 return; 176 return;
170 177
171 RenderFrameHostManager* manager = 178 RenderFrameHostManager* manager =
172 frame_proxy_in_parent_renderer_->frame_tree_node()->render_manager(); 179 frame_proxy_in_parent_renderer_->frame_tree_node()->render_manager();
173 RenderWidgetHostImpl* parent_widget = 180 RenderWidgetHostImpl* parent_widget =
174 manager->ForInnerDelegate() 181 manager->ForInnerDelegate()
175 ? manager->GetOuterRenderWidgetHostForKeyboardInput() 182 ? manager->GetOuterRenderWidgetHostForKeyboardInput()
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 child_widget->NotifyScreenInfoChanged(); 218 child_widget->NotifyScreenInfoChanged();
212 } 219 }
213 } 220 }
214 221
215 void CrossProcessFrameConnector::SetSize(gfx::Rect frame_rect) { 222 void CrossProcessFrameConnector::SetSize(gfx::Rect frame_rect) {
216 child_frame_rect_ = frame_rect; 223 child_frame_rect_ = frame_rect;
217 if (view_) 224 if (view_)
218 view_->SetSize(frame_rect.size()); 225 view_->SetSize(frame_rect.size());
219 } 226 }
220 227
228 RenderWidgetHostViewBase*
229 CrossProcessFrameConnector::GetRootRenderWidgetHostView() {
230 return static_cast<RenderWidgetHostViewBase*>(
231 frame_proxy_in_parent_renderer_->frame_tree_node()
232 ->frame_tree()
233 ->root()
234 ->current_frame_host()
235 ->GetView());
236 }
237
221 } // namespace content 238 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698