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

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: Nits 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java » ('j') | 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/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..21171d34be9e97abf8974de6dd31b761e8c03261 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 mIsDetachedForReparenting;
+
+ /**
* 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) {
+ mIsDetachedForReparenting = 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();
+ mIsDetachedForReparenting = false;
+ }
+
+ /**
+ * @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 mIsDetachedForReparenting;
}
/**
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698