Chromium Code Reviews| 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; |
|
boliu
2015/07/15 06:38:46
This should be per context, instead of per content
gsennton
2015/07/15 19:26:21
I don't quite understand this, aren't we only hold
boliu
2015/07/16 14:36:56
Many ContentViewCore can have the same context, in
gsennton
2015/10/20 13:27:12
Is there any way for us to guarantee that we can c
boliu
2015/10/20 15:07:22
Those don't have to move? Change
ScreenOrientatio
gsennton
2015/10/20 18:46:44
Ah, we could have the WindowAndroids be ScreenOrie
boliu
2015/10/21 15:54:59
The issue to be careful with supporting adding he
gsennton
2015/10/21 16:35:32
Right, the removal is problematic...
We already
|
| + |
| /** |
| * @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); |