Chromium Code Reviews| 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
|
| } |
| /** |