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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/Tab.java

Issue 843883002: [Android] Fix a flicker in stopping Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added 'private' to mStarted 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
index 2cc653a9ecb0b14ca0359e2f02aaf8ceb7e2ef22..c4804519ae1a20fcad35e03fb25b9ef4479c104e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
@@ -8,6 +8,7 @@ import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
+import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.ContextMenu;
@@ -271,6 +272,8 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
*/
private View mSadTabView;
+ private boolean mStarted;
+
/**
* A default {@link ChromeContextMenuItemDelegate} that supports some of the context menu
* functionality.
@@ -1065,6 +1068,7 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
* on both cold and warm starts.
*/
public void onActivityStart() {
+ mStarted = true;
show(TabSelectionType.FROM_USER);
// When resuming the activity, force an update to the fullscreen state to ensure a
@@ -1077,7 +1081,15 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
* Called on the foreground tab when the Activity is stopped.
*/
public void onActivityStop() {
- hide();
+ // Delay hiding in order to avoid a white flicker in closing an activity.
+ mStarted = false;
+ final Handler handler = new Handler();
+ handler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ if (!mStarted) hide();
+ }
+ }, 500);
David Trainor- moved to gerrit 2015/01/09 18:07:52 Does this only happen on L and above? Should we o
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698