summaryrefslogtreecommitdiffstats
path: root/android_webview/java
diff options
context:
space:
mode:
authoraruslan@chromium.org <aruslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-27 23:52:34 +0000
committeraruslan@chromium.org <aruslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-27 23:52:34 +0000
commitfa8562ec457b23ea817811080f2a72a0d1480de1 (patch)
tree3bec29c84c246f1b4c68a41beb702e6ffd54ea13 /android_webview/java
parent7a7736848d087c6189ba6cd40ddc635f2b20438e (diff)
downloadchromium_src-fa8562ec457b23ea817811080f2a72a0d1480de1.zip
chromium_src-fa8562ec457b23ea817811080f2a72a0d1480de1.tar.gz
chromium_src-fa8562ec457b23ea817811080f2a72a0d1480de1.tar.bz2
This is a no-op CL (with exceptions of int->float switch and the units used for scrolling).
All necessary fixes for incorrect units/transforms had been already landed. - Removed ScheduleUpdateFrameInfo() and SendUpdateFrameInfo(). - Extracted a RenderCoordinates utility class that caches the floating point frame info received from the renderer. - Scroll offset/extent/range are now in physical pixels. - Clarified and unified unit conversions (pix vs css vs dp) where reasonable. - Switched CompositorFrameInfo to use floats and changed ContentViewCore accordingly where feasible. BUG=174102, 175499, 175497 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/12278024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/java')
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwContents.java17
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwLayoutSizer.java6
2 files changed, 17 insertions, 6 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 99b0251..62ef745 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -85,6 +85,17 @@ public class AwContents {
void setMeasuredDimension(int measuredWidth, int measuredHeight);
}
+ /**
+ * Listener for renderer state change notifications coming through ContentViewCore.
+ */
+ private class AwContentStateChangeListener
+ implements ContentViewCore.ContentSizeChangeListener {
+ @Override
+ public void onContentSizeChanged(int contentWidthPix, int contentHeightPix) {
+ mLayoutSizer.onContentSizeChanged(contentWidthPix, contentHeightPix);
+ }
+ }
+
private int mNativeAwContents;
private AwBrowserContext mBrowserContext;
private ViewGroup mContainerView;
@@ -261,7 +272,7 @@ public class AwContents {
isAccessFromFileURLsGrantedByDefault);
mContentViewCore.setContentViewClient(mContentsClient);
mLayoutSizer = new AwLayoutSizer(new AwLayoutSizerDelegate());
- mContentViewCore.setContentSizeChangeListener(mLayoutSizer);
+ mContentViewCore.setContentSizeChangeListener(new AwContentStateChangeListener());
mContentsClient.installWebContentsObserver(mContentViewCore);
mSettings = new AwSettings(mContentViewCore.getContext(), nativeWebContents);
@@ -348,11 +359,11 @@ public class AwContents {
}
public int getContentHeightCss() {
- return getContentViewCore().getContentHeight();
+ return (int) Math.ceil(getContentViewCore().getContentHeightCss());
}
public int getContentWidthCss() {
- return getContentViewCore().getContentWidth();
+ return (int) Math.ceil(getContentViewCore().getContentWidthCss());
}
public Picture capturePicture() {
diff --git a/android_webview/java/src/org/chromium/android_webview/AwLayoutSizer.java b/android_webview/java/src/org/chromium/android_webview/AwLayoutSizer.java
index c698ade..d5ff108 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwLayoutSizer.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwLayoutSizer.java
@@ -13,13 +13,13 @@ import org.chromium.content.browser.ContentViewCore;
/**
* Helper methods used to manage the layout of the View that contains AwContents.
*/
-public class AwLayoutSizer implements ContentViewCore.ContentSizeChangeListener {
+public class AwLayoutSizer {
// These are used to prevent a re-layout if the content size changes within a dimension that is
// fixed by the view system.
private boolean mWidthMeasurementIsFixed;
private boolean mHeightMeasurementIsFixed;
- // Size of the rendered content, as reported by native.
+ // Size of the rendered content, as reported by native, in physical pixels.
private int mContentHeight;
private int mContentWidth;
@@ -39,8 +39,8 @@ public class AwLayoutSizer implements ContentViewCore.ContentSizeChangeListener
* Update the contents size.
* This should be called whenever the content size changes (due to DOM manipulation or page
* load, for example).
+ * The width and height should be in physical pixels.
*/
- @Override
public void onContentSizeChanged(int width, int height) {
boolean layoutNeeded = (mContentWidth != width && !mWidthMeasurementIsFixed) ||
(mContentHeight != height && !mHeightMeasurementIsFixed);