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

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

Issue 1420203007: Correctly find root RWHV from a nested WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 void CrossProcessFrameConnector::SetSize(gfx::Rect frame_rect) { 222 void CrossProcessFrameConnector::SetSize(gfx::Rect frame_rect) {
223 child_frame_rect_ = frame_rect; 223 child_frame_rect_ = frame_rect;
224 if (view_) 224 if (view_)
225 view_->SetSize(frame_rect.size()); 225 view_->SetSize(frame_rect.size());
226 } 226 }
227 227
228 RenderWidgetHostViewBase* 228 RenderWidgetHostViewBase*
229 CrossProcessFrameConnector::GetRootRenderWidgetHostView() { 229 CrossProcessFrameConnector::GetRootRenderWidgetHostView() {
230 return static_cast<RenderWidgetHostViewBase*>( 230 RenderFrameHostImpl* top_host = frame_proxy_in_parent_renderer_->
231 frame_proxy_in_parent_renderer_->frame_tree_node() 231 frame_tree_node()->frame_tree()->root()->current_frame_host();
232 ->frame_tree() 232
233 ->root() 233 // This method should return the root RWHV from the top-level WebContents,
234 ->current_frame_host() 234 // in the case of nested WebContents.
235 ->GetView()); 235 if (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) {
nasko 2015/10/30 21:29:12 This will just go one level up, right? I'm not sur
kenrb 2015/10/30 21:40:40 I guess it might be more intuitive to do this. Ori
236 top_host = top_host->frame_tree_node()->render_manager()->
237 GetOuterDelegateNode()->frame_tree()->root()->current_frame_host();
238 }
239
240 return static_cast<RenderWidgetHostViewBase*>(top_host->GetView());
236 } 241 }
237 242
238 } // namespace content 243 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698