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 d9771f74edd7707bc3043936bc23f221dfcc358f..962e610524218aac6b71d81020190f55396a2974 100644 |
--- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
+++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java |
@@ -16,11 +16,13 @@ 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; |
import android.view.View; |
import android.view.ViewGroup; |
+import android.view.Window; |
import android.view.accessibility.AccessibilityManager; |
import org.chromium.base.ApiCompatibilityUtils; |
@@ -726,6 +728,20 @@ public class WindowAndroid { |
} |
/** |
+ * Return the current window token, or null. |
+ */ |
+ @CalledByNative |
+ private IBinder getWindowToken() { |
+ Activity activity = activityFromContext(mContextRef.get()); |
+ if (activity == null) return null; |
+ Window window = activity.getWindow(); |
+ if (window == null) return null; |
+ View decorView = window.peekDecorView(); |
+ if (decorView == null) return null; |
+ return decorView.getWindowToken(); |
+ } |
+ |
+ /** |
* 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, |