Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java |
| index 308d418a1468185ae64aeef1cba5b67d9d9d691b..7a99ccd3cbde456cec5f42ef476a6fcc059d9fe9 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java |
| @@ -352,6 +352,12 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener, |
| private boolean mIsFullscreenWaitingForLoad = false; |
| /** |
| + * Indicates whether this tab has been detached from its activity and the corresponding |
| + * {@link WindowAndroid} for reparenting to a new activity. |
| + */ |
| + private boolean mDetachedForReparenting; |
| + |
| + /** |
| * The UMA object used to report stats for this tab. Note that this may be null under certain |
| * conditions, such as incognito mode. |
| */ |
| @@ -1419,6 +1425,7 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener, |
| */ |
| public boolean detachAndStartReparenting(Intent intent, Bundle startActivityOptions, |
| Runnable finalizeCallback) { |
| + mDetachedForReparenting = true; |
| ChromeActivity activity = getActivity(); |
| if (activity == null) return false; |
| TabModelSelector tabModelSelector = getTabModelSelector(); |
| @@ -1482,6 +1489,17 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener, |
| maybeShowNativePage(getUrl(), true); |
| reparentingParams.finalizeTabReparenting(); |
| + mDetachedForReparenting = false; |
|
gone
2016/04/26 22:05:38
nit: mIsDetachedForReparenting
Yusuf
2016/04/26 22:10:15
Done.
|
| + } |
| + |
| + /** |
| + * @return Whether the tab is detached from its Activity and {@link WindowAndroid} for |
| + * reparenting. Certain functionalities will not work until it is attached to a new activity |
| + * with {@link Tab#attachAndFinishReparenting( |
| + * ChromeActivity, TabDelegateFactory, TabReparentingParams)}. |
| + */ |
| + public boolean isDetachedForReparenting() { |
| + return mDetachedForReparenting; |
| } |
| /** |