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

Unified Diff: ui/android/java/src/org/chromium/ui/base/WindowAndroid.java

Issue 1144333004: Make WebView work for external displays (over Presentations). Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor naming/comment fixes Created 5 years, 5 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
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 27579e6e3ad4a3888f486f246f4f13e1c17e0c20..43091e9f2f6dd9a485474703c5e2db9df14f8e7a 100644
--- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
+++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
@@ -76,6 +76,7 @@ public class WindowAndroid {
protected Context mApplicationContext;
protected SparseArray<IntentCallback> mOutstandingIntents;
+ protected WeakReference<Context> mDisplayContextRef;
boliu 2015/07/15 06:38:47 Add comment why this is needed
gsennton 2015/07/15 19:26:21 Done.
// Ideally, this would be a SparseArray<String>, but there's no easy way to store a
// SparseArray<String> in a bundle during saveInstanceState(). So we use a HashMap and suppress
@@ -131,12 +132,13 @@ public class WindowAndroid {
* @param context The application context.
*/
@SuppressLint("UseSparseArrays")
- public WindowAndroid(Context context) {
+ public WindowAndroid(Context context, Context displayContext) {
boliu 2015/07/15 06:38:46 Only need |displayContext|. |context| is always di
gsennton 2015/07/15 19:26:21 Done.
assert context == context.getApplicationContext();
mApplicationContext = context;
+ mDisplayContextRef = new WeakReference<Context>(displayContext);
mOutstandingIntents = new SparseArray<IntentCallback>();
mIntentErrors = new HashMap<Integer, String>();
- mVSyncMonitor = new VSyncMonitor(context, mVSyncListener);
+ mVSyncMonitor = new VSyncMonitor(displayContext, mVSyncListener);
mAccessibilityManager = (AccessibilityManager)
context.getSystemService(Context.ACCESSIBILITY_SERVICE);
}
@@ -562,6 +564,11 @@ public class WindowAndroid {
});
}
+ @CalledByNative
+ public Context getDisplayContext() {
boliu 2015/07/15 06:38:46 private Why is this needed at all?
gsennton 2015/07/15 19:26:21 To be called from the native side when creating th
+ return mDisplayContextRef.get();
+ }
+
/**
* 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

Powered by Google App Engine
This is Rietveld 408576698