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 e6eb23a536823ecf8c691e22078af60c14dc27e6..a9b7546693616cd251694264d7ce5d180d06e1a6 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 |
| @@ -464,6 +464,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
| private int mPhysicalBackingHeightPix; |
| private int mTopControlsHeightPix; |
| private boolean mTopControlsShrinkBlinkSize; |
| + private Rect mWindowInsets; |
|
aelias_OOO_until_Jul13
2016/02/24 02:43:59
As I mentioned in #31, I'd like this to be stored
ymalik
2016/03/03 02:10:18
Done.
|
| // Cached copy of all positions and scales as reported by the renderer. |
| private final RenderCoordinates mRenderCoordinates; |
| @@ -601,6 +602,8 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
| mGestureStateListenersIterator = mGestureStateListeners.rewindableIterator(); |
| mContainerViewObservers = new ObserverList<ContainerViewObserver>(); |
| + |
| + mWindowInsets = new Rect(); |
| } |
| /** |
| @@ -619,6 +622,25 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
| } |
| /** |
| + * @return The system window insets (from OSK, status bar, etc). |
| + */ |
| + private Rect getWindowInsets() { |
| + return mWindowInsets != null ? mWindowInsets : new Rect(); |
| + } |
| + |
| + /** |
| + * Set the window insets Rect to the specified values. |
| + * |
| + * @param left The left window inset |
| + * @param top The top window inset. |
| + * @param right The right window inset. |
| + * @param bottom The bottom window inset. |
| + */ |
| + public void setWindowInsets(int left, int top, int right, int bottom) { |
| + mWindowInsets.set(left, top, right, bottom); |
| + } |
| + |
| + /** |
| * @return The WebContents currently being rendered. |
| */ |
| public WebContents getWebContents() { |
| @@ -1017,6 +1039,14 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
| } |
| /** |
| + * @return Viewport height when the OSK is hidden in physical pixels as set from onSizeChanged. |
| + */ |
| + @CalledByNative |
| + public int getViewportHeightWithOSKHiddenPix() { |
| + return mViewportHeightPix + getWindowInsets().bottom; |
| + } |
| + |
| + /** |
| * @return Width of underlying physical surface. |
| */ |
| @CalledByNative |