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

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

Issue 1924473002: Don't hide the reparenting tab while detaching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: 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;
}
/**

Powered by Google App Engine
This is Rietveld 408576698