[android_webview] Use a fraction to calculate scroll offset.
commit20d2b74ccb40341d001ab30cd74ac320891dde5b
authormkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 26 Sep 2013 05:41:34 +0000 (26 05:41 +0000)
committermkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 26 Sep 2013 05:41:34 +0000 (26 05:41 +0000)
treeb47ee11cf628a5faf7f0d60b8a612ac22c59c199
parentcc5c6819970a9a9a3d6d4f6f68e21e4b0f564e7d
[android_webview] Use a fraction to calculate scroll offset.

android_webview/ has to expose scroll offset operations in physical
pixels while cc/ stores scroll offsets in dip pixels.
Unfortunately the physical pixel values android_webview/ exposes are
rounded so there is no such combination of rounding operations that
allows for scrolls to 'bottom' in one corrdinate space to always be
'flush' against the bottom edge in the other. The most natural
solution is to convert the scroll offset to the fraction of the
scroll range.
By using the max_scroll_offset value obtained directly from the compositor
we're also removing the need to delay scrolls since the content size
is always as recent as the scroll offset update.

BUG=261239

Review URL: https://codereview.chromium.org/23533051

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225348 0039d316-1c4b-4281-b951-d872f2087c98
18 files changed:
android_webview/browser/browser_view_renderer.h
android_webview/browser/in_process_view_renderer.cc
android_webview/browser/in_process_view_renderer.h
android_webview/java/src/org/chromium/android_webview/AwContents.java
android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java
android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
android_webview/javatests/src/org/chromium/android_webview/test/AwScrollOffsetManagerTest.java
android_webview/native/aw_contents.cc
android_webview/native/aw_contents.h
cc/input/layer_scroll_offset_delegate.h
cc/layers/layer_impl.cc
cc/layers/layer_impl_unittest.cc
cc/trees/layer_tree_host_impl_unittest.cc
cc/trees/layer_tree_impl.cc
content/browser/android/in_process/synchronous_compositor_impl.cc
content/browser/android/in_process/synchronous_compositor_impl.h
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
content/public/browser/android/synchronous_compositor_client.h