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

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

Issue 2154833002: Ignore show messages from RemoteFrames when the WebContents is hidden. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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
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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 // If there is an inner WebContents, it should be notified of the change in 266 // If there is an inner WebContents, it should be notified of the change in
267 // the visibility. The Show/Hide methods will not be called if an inner 267 // the visibility. The Show/Hide methods will not be called if an inner
268 // WebContents exists since the corresponding WebContents will itself call 268 // WebContents exists since the corresponding WebContents will itself call
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);
kenrb 2016/07/18 17:11:45 Why is the check done in the WebContents rather th
lfg 2016/07/18 17:44:00 No particular reason, I just thought the check in
kenrb 2016/07/18 18:05:28 Okay, that's fine. The only advantage of having it
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698