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 a4b3825d3c6a5c98095429f34d39c8a8fdf36c54..d96ad0d76f4d109138440e7490b9c0724408744d 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 |
@@ -17,6 +17,7 @@ import android.net.Uri; |
import android.os.Bundle; |
import android.provider.Browser; |
import android.support.annotation.Nullable; |
+import android.support.v4.view.ViewCompat; |
import android.text.TextUtils; |
import android.util.Log; |
import android.view.ContextThemeWrapper; |
@@ -2238,6 +2239,16 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener, |
} |
/** |
+ * @return Whether the tab can currently be interacted with by the user. This requires the |
+ * view to be visible and in a state the user can manipulate the tab (i.e. not in |
+ * something like the phone tab switcher). |
gone
2017/01/13 18:54:37
How does this work for a tablet, where the tab mig
Ted C
2017/01/20 16:57:46
Updated the comment to clarify the tab's view need
|
+ */ |
+ @CalledByNative |
+ public boolean isUserInteractable() { |
+ return !mIsHidden && ViewCompat.isAttachedToWindow(getView()); |
+ } |
+ |
+ /** |
* @return Whether or not the tab is in the closing process. |
*/ |
public boolean isClosing() { |