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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 24101003: Make the RenderViewHostImpl update its visibility after a swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't show the new RWHV if WebContents is hidden. Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index ed555cc02ee3902056d4e34ae76f00031fe416cf..1703160c4f31046ca45136d2a1410101fd6b1926 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -690,20 +690,26 @@ RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const {
}
void RenderWidgetHostViewAura::WasShown() {
+ DCHECK(host_);
if (!host_->is_hidden())
return;
host_->WasShown();
if (framebuffer_holder_)
FrameMemoryManager::GetInstance()->SetFrameVisibility(this, true);
- aura::client::CursorClient* cursor_client =
- aura::client::GetCursorClient(window_->GetRootWindow());
- if (cursor_client)
- NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible());
+ aura::RootWindow* root = window_->GetRootWindow();
+ if (root) {
+ aura::client::CursorClient* cursor_client =
+ aura::client::GetCursorClient(root);
+ if (cursor_client)
+ NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible());
+ }
if (!current_surface_.get() && host_->is_accelerated_compositing_active() &&
!released_front_lock_.get()) {
- released_front_lock_ = GetCompositor()->GetCompositorLock();
+ ui::Compositor* compositor = GetCompositor();
+ if (compositor)
+ released_front_lock_ = compositor->GetCompositorLock();
}
#if defined(OS_WIN)
@@ -714,7 +720,7 @@ void RenderWidgetHostViewAura::WasShown() {
}
void RenderWidgetHostViewAura::WasHidden() {
- if (host_->is_hidden())
+ if (!host_ || host_->is_hidden())
return;
host_->WasHidden();
if (framebuffer_holder_)
@@ -961,10 +967,12 @@ bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const {
void RenderWidgetHostViewAura::Show() {
window_->Show();
+ WasShown();
}
void RenderWidgetHostViewAura::Hide() {
window_->Hide();
+ WasHidden();
}
bool RenderWidgetHostViewAura::IsShowing() {

Powered by Google App Engine
This is Rietveld 408576698