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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java

Issue 843883002: [Android] Fix a flicker in stopping Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using onWindowVisibilityChanged Created 5 years, 11 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/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
index a3093989bc9aee50284d64adfc8379434f8d4896..44638495236d0941d90a74b3193b432e914d76a3 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
@@ -10,6 +10,7 @@ import android.graphics.PixelFormat;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
+import android.view.View;
import android.widget.FrameLayout;
import org.chromium.base.CalledByNative;
@@ -156,6 +157,18 @@ public class ContentViewRenderView extends FrameLayout {
nativeSetNeedsComposite(mNativeContentViewRenderView);
}
+ boolean mWindowShown;
David Trainor- moved to gerrit 2015/01/15 01:16:07 private, move to top of file with other variables.
Changwan Ryu 2015/01/15 01:51:34 Removed.
+
+ @Override
+ protected void onWindowVisibilityChanged(int visibility) {
+ boolean windowShown = visibility == View.VISIBLE;
David Trainor- moved to gerrit 2015/01/15 01:16:07 See earlier comment in TabManager.
Changwan Ryu 2015/01/15 01:51:34 Done.
+ if (windowShown != mWindowShown) {
+ if (!windowShown) onWindowHidden();
+ mWindowShown = windowShown;
+ }
+ super.onWindowVisibilityChanged(visibility);
+ }
+
/**
* This method should be subclassed to provide actions to be performed once the view is ready to
* render.
@@ -164,6 +177,13 @@ public class ContentViewRenderView extends FrameLayout {
}
/**
+ * This method should be subclassed to provide actions to be performed once the window is
+ * hidden.
+ */
+ protected void onWindowHidden() {
+ }
+
+ /**
* This method could be subclassed optionally to provide a custom SurfaceView object to
* this ContentViewRenderView.
* @param context The context used to create the SurfaceView object.

Powered by Google App Engine
This is Rietveld 408576698