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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 child_widget->NotifyScreenInfoChanged(); | 270 child_widget->NotifyScreenInfoChanged(); |
271 } | 271 } |
272 } | 272 } |
273 | 273 |
274 void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) { | 274 void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) { |
275 gfx::Rect old_rect = child_frame_rect_; | 275 gfx::Rect old_rect = child_frame_rect_; |
276 child_frame_rect_ = frame_rect; | 276 child_frame_rect_ = frame_rect; |
277 if (view_) { | 277 if (view_) { |
278 view_->SetBounds(frame_rect); | 278 view_->SetBounds(frame_rect); |
279 | 279 |
280 // Out-of-process iframes nested underneath this one implicitly have their | 280 // Other local root frames nested underneath this one implicitly have their |
281 // view rects changed when their ancestor is repositioned, and therefore | 281 // view rects changed when their ancestor is repositioned, and therefore |
282 // need to have their screen rects updated. | 282 // need to have their screen rects updated. |
283 FrameTreeNode* proxy_node = | 283 FrameTreeNode* proxy_node = |
284 frame_proxy_in_parent_renderer_->frame_tree_node(); | 284 frame_proxy_in_parent_renderer_->frame_tree_node(); |
285 if (old_rect.x() != child_frame_rect_.x() || | 285 if (old_rect.x() != child_frame_rect_.x() || |
286 old_rect.y() != child_frame_rect_.y()) { | 286 old_rect.y() != child_frame_rect_.y()) { |
287 for (FrameTreeNode* node : | 287 for (FrameTreeNode* node : |
288 proxy_node->frame_tree()->SubtreeNodes(proxy_node)) { | 288 proxy_node->frame_tree()->SubtreeNodes(proxy_node)) { |
289 if (node != proxy_node && | 289 if (node != proxy_node && node->current_frame_host()->is_local_root()) |
290 node->current_frame_host()->GetRenderWidgetHost()) | |
291 node->current_frame_host()->GetRenderWidgetHost()->SendScreenRects(); | 290 node->current_frame_host()->GetRenderWidgetHost()->SendScreenRects(); |
292 } | 291 } |
293 } | 292 } |
294 } | 293 } |
295 } | 294 } |
296 | 295 |
297 RenderWidgetHostViewBase* | 296 RenderWidgetHostViewBase* |
298 CrossProcessFrameConnector::GetRootRenderWidgetHostView() { | 297 CrossProcessFrameConnector::GetRootRenderWidgetHostView() { |
299 RenderFrameHostImpl* top_host = frame_proxy_in_parent_renderer_-> | 298 RenderFrameHostImpl* top_host = frame_proxy_in_parent_renderer_-> |
300 frame_tree_node()->frame_tree()->root()->current_frame_host(); | 299 frame_tree_node()->frame_tree()->root()->current_frame_host(); |
(...skipping 25 matching lines...) Expand all Loading... |
326 | 325 |
327 if (parent) { | 326 if (parent) { |
328 return static_cast<RenderWidgetHostViewBase*>( | 327 return static_cast<RenderWidgetHostViewBase*>( |
329 parent->current_frame_host()->GetView()); | 328 parent->current_frame_host()->GetView()); |
330 } | 329 } |
331 | 330 |
332 return nullptr; | 331 return nullptr; |
333 } | 332 } |
334 | 333 |
335 } // namespace content | 334 } // namespace content |
OLD | NEW |