Index: ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
diff --git a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
index 7fc6180aecdd009f0fe60a5ac36847a175630ead..a03d9ebaddebe3080d4ad53ffac6d13ce33a79b7 100644 |
--- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
+++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
@@ -17,6 +17,7 @@ import android.content.Intent; |
import android.content.pm.PackageManager; |
import android.os.Build; |
import android.os.Bundle; |
+import android.os.IBinder; |
import android.os.Process; |
import android.util.Log; |
import android.util.SparseArray; |
@@ -663,6 +664,19 @@ public class WindowAndroid { |
} |
/** |
+ * Return the current window token, or null. |
+ * TODO(liberato): explain this better. also mention embedders.t d |
+ */ |
+ public IBinder getWindowToken() { |
+ Context context = mContextRef.get(); |
+ if (context == null) return null; |
+ Activity activity = activityFromContext(context); |
+ if (activity == null) return null; |
+ |
+ return activity.getWindow().getDecorView().getRootView().getWindowToken(); |
boliu
2016/11/14 16:39:25
peekDecorView might be safer, but need a null chec
liberato (no reviews please)
2016/12/20 17:16:38
peekDecorView: done.
getRootView: now that you men
|
+ } |
+ |
+ /** |
* Update whether the placeholder is 'drawn' based on whether an animation is running |
* or touch exploration is enabled - if either of those are true, we call |
* setWillNotDraw(false) to ensure that the animation is drawn over the SurfaceView, |