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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 1144333004: Make WebView work for external displays (over Presentations). Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fixes according to boliu/jdduke's comments 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: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 929e494039c791499ebb359716cf9526ab8b12d8..da3c9480df1091bbb5914156ef73c833a237ae86 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -601,6 +601,9 @@ public class ContentViewCore implements
// The client that implements Contextual Search functionality, or null if none exists.
private ContextualSearchClient mContextualSearchClient;
+ // Listener for screen orientation changes.
+ private ScreenOrientationListener mScreenOrientationListener;
+
/**
* @param webContents The {@link WebContents} to find a {@link ContentViewCore} of.
* @return A {@link ContentViewCore} that is connected to {@code webContents} or
@@ -639,6 +642,7 @@ public class ContentViewCore implements
mEditable = Editable.Factory.getInstance().newEditable("");
Selection.setSelection(mEditable, 0);
mContainerViewObservers = new ObserverList<ContainerViewObserver>();
+ mScreenOrientationListener = new ScreenOrientationListener(mContext);
}
/**
@@ -1002,7 +1006,7 @@ public class ContentViewCore implements
mRetainedJavaScriptObjects.clear();
unregisterAccessibilityContentObserver();
mGestureStateListeners.clear();
- ScreenOrientationListener.getInstance().removeObserver(this);
+ mScreenOrientationListener.removeObserver(this);
mPositionObserver.clearListener();
mContainerViewObservers.clear();
@@ -1493,7 +1497,7 @@ public class ContentViewCore implements
setAccessibilityState(mAccessibilityManager.isEnabled());
setTextHandlesTemporarilyHidden(false);
restoreSelectionPopupsIfNecessary();
- ScreenOrientationListener.getInstance().addObserver(this, mContext);
+ mScreenOrientationListener.addObserver(this);
GamepadList.onAttachedToWindow(mContext);
mAccessibilityManager.addAccessibilityStateChangeListener(this);
mSystemCaptioningBridge.addListener(this);
@@ -1508,7 +1512,7 @@ public class ContentViewCore implements
mZoomControlsDelegate.dismissZoomPicker();
unregisterAccessibilityContentObserver();
- ScreenOrientationListener.getInstance().removeObserver(this);
+ mScreenOrientationListener.removeObserver(this);
GamepadList.onDetachedFromWindow();
mAccessibilityManager.removeAccessibilityStateChangeListener(this);

Powered by Google App Engine
This is Rietveld 408576698