| 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_hittest.h" | 8 #include "cc/surfaces/surface_hittest.h" |
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 10 #include "content/browser/compositor/surface_utils.h" | 10 #include "content/browser/compositor/surface_utils.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 view_->Show(); | 317 view_->Show(); |
| 318 } else if (!visible) { | 318 } else if (!visible) { |
| 319 view_->Hide(); | 319 view_->Hide(); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| 323 void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) { | 323 void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) { |
| 324 gfx::Rect old_rect = child_frame_rect_; | 324 gfx::Rect old_rect = child_frame_rect_; |
| 325 child_frame_rect_ = frame_rect; | 325 child_frame_rect_ = frame_rect; |
| 326 if (view_) { | 326 if (view_) { |
| 327 view_->SetBounds(frame_rect); | 327 view_->RequestTopLevelBoundsInScreen(frame_rect); |
| 328 | 328 |
| 329 // Other local root frames nested underneath this one implicitly have their | 329 // Other local root frames nested underneath this one implicitly have their |
| 330 // view rects changed when their ancestor is repositioned, and therefore | 330 // view rects changed when their ancestor is repositioned, and therefore |
| 331 // need to have their screen rects updated. | 331 // need to have their screen rects updated. |
| 332 FrameTreeNode* proxy_node = | 332 FrameTreeNode* proxy_node = |
| 333 frame_proxy_in_parent_renderer_->frame_tree_node(); | 333 frame_proxy_in_parent_renderer_->frame_tree_node(); |
| 334 if (old_rect.x() != child_frame_rect_.x() || | 334 if (old_rect.x() != child_frame_rect_.x() || |
| 335 old_rect.y() != child_frame_rect_.y()) { | 335 old_rect.y() != child_frame_rect_.y()) { |
| 336 for (FrameTreeNode* node : | 336 for (FrameTreeNode* node : |
| 337 proxy_node->frame_tree()->SubtreeNodes(proxy_node)) { | 337 proxy_node->frame_tree()->SubtreeNodes(proxy_node)) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 if (parent) { | 375 if (parent) { |
| 376 return static_cast<RenderWidgetHostViewBase*>( | 376 return static_cast<RenderWidgetHostViewBase*>( |
| 377 parent->current_frame_host()->GetView()); | 377 parent->current_frame_host()->GetView()); |
| 378 } | 378 } |
| 379 | 379 |
| 380 return nullptr; | 380 return nullptr; |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace content | 383 } // namespace content |
| OLD | NEW |