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

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

Issue 2106753004: Introduce bottom controls to CC and let it respond to scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change to height and ratio Created 4 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/RenderCoordinates.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java b/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java
index c56660c2c99ccbd48ac9face8ba7c9f2401ca017..7670ea3b6ebbf3f01a060e55d66b1369513cbc47 100644
--- a/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java
+++ b/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java
@@ -36,7 +36,8 @@ public class RenderCoordinates {
// Cached device density.
private float mDeviceScaleFactor;
- private float mContentOffsetYPix;
+ private float mTopControlsShownYPix;
+ private float mBottomControlsShownYPix;
private boolean mHasFrameInfo;
@@ -61,13 +62,14 @@ public class RenderCoordinates {
float contentWidthCss, float contentHeightCss,
float viewportWidthCss, float viewportHeightCss,
float pageScaleFactor, float minPageScaleFactor, float maxPageScaleFactor,
- float contentOffsetYPix) {
+ float topControlsShownYPix, float bottomControlsShownYPix) {
mScrollXCss = scrollXCss;
mScrollYCss = scrollYCss;
mPageScaleFactor = pageScaleFactor;
mMinPageScaleFactor = minPageScaleFactor;
mMaxPageScaleFactor = maxPageScaleFactor;
- mContentOffsetYPix = contentOffsetYPix;
+ mTopControlsShownYPix = topControlsShownYPix;
+ mBottomControlsShownYPix = bottomControlsShownYPix;
updateContentSizeCss(contentWidthCss, contentHeightCss);
mLastFrameViewportWidthCss = viewportWidthCss;
@@ -78,14 +80,14 @@ public class RenderCoordinates {
/**
* Sets several fields for unit test. (used by {@link CursorAnchorInfoControllerTest}).
- * @param deviceScaleFactor Device scale factor (maps DIP pixels to physical pixels).
- * @param contentOffsetYPix Physical on-screen Y offset amount below the top controls.
+ * @param deviceScaleFactor Device scale factor (maps DIP pixels to physical pixels).
+ * @param topControlsShownYPix Physical on-screen Y offset amount the top controls shows.
*/
@VisibleForTesting
- public void setFrameInfoForTest(float deviceScaleFactor, float contentOffsetYPix) {
+ public void setFrameInfoForTest(float deviceScaleFactor, float topControlsShownYPix) {
reset();
mDeviceScaleFactor = deviceScaleFactor;
- mContentOffsetYPix = contentOffsetYPix;
+ mTopControlsShownYPix = topControlsShownYPix;
}
/**
@@ -137,7 +139,7 @@ public class RenderCoordinates {
* @return Physical (screen) Y coordinate of the point.
*/
public float getYPix() {
- return getYLocalDip() * mDeviceScaleFactor + mContentOffsetYPix;
+ return getYLocalDip() * mDeviceScaleFactor + mTopControlsShownYPix;
}
/**
@@ -299,10 +301,15 @@ public class RenderCoordinates {
}
/**
- * @return The Physical on-screen Y offset amount below the top controls.
+ * @return The Physical on-screen Y offset amount between the top of the web content and the
+ * bottom of the status bar.
*/
- public float getContentOffsetYPix() {
- return mContentOffsetYPix;
+ public float getTopControlsShownYPix() {
+ return mTopControlsShownYPix;
+ }
+
+ public float getBottomControlsShownYPix() {
+ return mBottomControlsShownYPix;
}
/**

Powered by Google App Engine
This is Rietveld 408576698