Chromium Code Reviews| 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 "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 Loading... | |
| 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 |
| OLD | NEW |