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

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

Issue 2628943003: Add metrics for triggering of JS dialogs on Android. (Closed)
Patch Set: Log only for confirm dialog Created 3 years, 11 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/browser/android/tab_android.h » ('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 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() {
« no previous file with comments | « no previous file | chrome/browser/android/tab_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698