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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index ae2806e715333df1cd7df7ec65186a8de7357c39..3b94566748f4d5fdbc9faa3fda6fb1f5194531fb 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -199,7 +199,7 @@ RenderWidgetHostViewAndroid::GetRenderWidgetHost() const {
}
void RenderWidgetHostViewAndroid::WasShown() {
- if (!host_->is_hidden())
+ if (!host_ || !host_->is_hidden())
return;
host_->WasShown();
@@ -208,7 +208,7 @@ void RenderWidgetHostViewAndroid::WasShown() {
void RenderWidgetHostViewAndroid::WasHidden() {
RunAckCallbacks();
- if (host_->is_hidden())
+ if (!host_ || host_->is_hidden())
return;
// Inform the renderer that we are being hidden so it can reduce its resource
@@ -356,6 +356,8 @@ void RenderWidgetHostViewAndroid::Show() {
are_layers_attached_ = true;
AttachLayers();
+
+ WasShown();
}
void RenderWidgetHostViewAndroid::Hide() {
@@ -364,6 +366,8 @@ void RenderWidgetHostViewAndroid::Hide() {
are_layers_attached_ = false;
RemoveLayers();
+
+ WasHidden();
}
bool RenderWidgetHostViewAndroid::IsShowing() {
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698