| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // Show/Hide on all the RenderWidgetHostViews (including this) one. | 269 // Show/Hide on all the RenderWidgetHostViews (including this) one. |
| 270 if (frame_proxy_in_parent_renderer_->frame_tree_node() | 270 if (frame_proxy_in_parent_renderer_->frame_tree_node() |
| 271 ->render_manager() | 271 ->render_manager() |
| 272 ->ForInnerDelegate()) { | 272 ->ForInnerDelegate()) { |
| 273 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()) | 273 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()) |
| 274 ->delegate() | 274 ->delegate() |
| 275 ->OnRenderFrameProxyVisibilityChanged(visible); | 275 ->OnRenderFrameProxyVisibilityChanged(visible); |
| 276 return; | 276 return; |
| 277 } | 277 } |
| 278 | 278 |
| 279 if (visible) | 279 if (visible && |
| 280 !RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()) |
| 281 ->delegate() |
| 282 ->IsHidden()) { |
| 280 view_->Show(); | 283 view_->Show(); |
| 281 else | 284 } else if (!visible) { |
| 282 view_->Hide(); | 285 view_->Hide(); |
| 286 } |
| 283 } | 287 } |
| 284 | 288 |
| 285 void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) { | 289 void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) { |
| 286 device_scale_factor_ = scale_factor; | 290 device_scale_factor_ = scale_factor; |
| 287 // The RenderWidgetHost is null in unit tests. | 291 // The RenderWidgetHost is null in unit tests. |
| 288 if (view_ && view_->GetRenderWidgetHost()) { | 292 if (view_ && view_->GetRenderWidgetHost()) { |
| 289 RenderWidgetHostImpl* child_widget = | 293 RenderWidgetHostImpl* child_widget = |
| 290 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()); | 294 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()); |
| 291 child_widget->NotifyScreenInfoChanged(); | 295 child_widget->NotifyScreenInfoChanged(); |
| 292 } | 296 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 350 |
| 347 if (parent) { | 351 if (parent) { |
| 348 return static_cast<RenderWidgetHostViewBase*>( | 352 return static_cast<RenderWidgetHostViewBase*>( |
| 349 parent->current_frame_host()->GetView()); | 353 parent->current_frame_host()->GetView()); |
| 350 } | 354 } |
| 351 | 355 |
| 352 return nullptr; | 356 return nullptr; |
| 353 } | 357 } |
| 354 | 358 |
| 355 } // namespace content | 359 } // namespace content |
| OLD | NEW |