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 7de8b4ae1d59448eb065e245f793592f7f3cf859..c5ce6ccb18e11c98dcb438228aa4c4f8e9392c33 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 |
@@ -501,6 +501,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
private int mPhysicalBackingWidthPix; |
private int mPhysicalBackingHeightPix; |
private int mTopControlsHeightPix; |
+ private int mBottomControlsHeightPix; |
private boolean mTopControlsShrinkBlinkSize; |
// Cached copy of all positions and scales as reported by the renderer. |
@@ -698,6 +699,15 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
} |
/** |
+ * Sets the height of the bottom controls. If necessary, triggers a renderer resize. |
+ */ |
+ public void setBottomControlsHeight(int bottomControlHeightPix) { |
+ if (mBottomControlsHeightPix == bottomControlHeightPix) return; |
+ mBottomControlsHeightPix = bottomControlHeightPix; |
+ if (mNativeContentViewCore != 0) nativeWasResized(mNativeContentViewCore); |
+ } |
+ |
+ /** |
* Returns a delegate that can be used to add and remove views from the current |
* container view. Clients can safely hold to instances of this class as it handles the |
* replacement of container views transparently. |
@@ -1096,6 +1106,11 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
return mTopControlsHeightPix; |
} |
+ @CalledByNative |
+ public int getBottomControlsHeightPix() { |
+ return mBottomControlsHeightPix; |
+ } |
+ |
/** |
* @return Current device scale factor (maps DIP pixels to physical pixels). |
*/ |
@@ -2373,6 +2388,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
float contentWidth, float contentHeight, |
float viewportWidth, float viewportHeight, |
float controlsOffsetYCss, float contentOffsetYCss, |
+ float bottomOffsetYCss, float bottomTranslateYCss, |
boolean isMobileOptimizedHint, |
boolean hasInsertionMarker, boolean isInsertionMarkerVisible, |
float insertionMarkerHorizontal, float insertionMarkerTop, |
@@ -2440,6 +2456,9 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen |
getContentViewClient().onOffsetsForFullscreenChanged( |
controlsOffsetPix, contentOffsetYPix); |
+ getContentViewClient().onBottomOffsetChanged(bottomOffsetYCss * deviceScale, |
bokan
2016/06/30 12:31:21
Shouldn't we check if the offsets actually changed
Ian Wen
2016/07/01 02:51:44
onOffsetsForFullscreenChanged() is the counterpart
bokan
2016/07/01 17:19:13
The documentation for that method also states that
Ian Wen
2016/07/06 20:53:44
I changed the comments of the two methods so that
|
+ bottomTranslateYCss * deviceScale); |
+ |
if (mBrowserAccessibilityManager != null) { |
mBrowserAccessibilityManager.notifyFrameInfoInitialized(); |
} |