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

Unified Diff: android_webview/native/aw_contents.cc

Issue 23533051: [android_webview] Use a fraction to calculate scroll offset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get rid of NaNs Created 7 years, 3 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: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index ac2cba3456c2441bc6bb8d99685348bc309221c5..376490a56c44607fbb34c80102911ec1cab5a8fe 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -800,6 +800,15 @@ gfx::Point AwContents::GetLocationOnScreen() {
return gfx::Point(location[0], location[1]);
}
+void AwContents::SetMaxContainerViewScrollOffset(gfx::Vector2d new_value) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return;
+ Java_AwContents_setMaxContainerViewScrollOffset(
+ env, obj.obj(), new_value.x(), new_value.y());
+}
+
void AwContents::ScrollContainerViewTo(gfx::Vector2d new_value) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
@@ -809,7 +818,6 @@ void AwContents::ScrollContainerViewTo(gfx::Vector2d new_value) {
env, obj.obj(), new_value.x(), new_value.y());
}
-
void AwContents::DidOverscroll(gfx::Vector2d overscroll_delta) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
@@ -836,8 +844,8 @@ void AwContents::SetFixedLayoutSize(JNIEnv* env,
render_view_host_ext_->SetFixedLayoutSize(gfx::Size(width_dip, height_dip));
}
-void AwContents::ScrollTo(JNIEnv* env, jobject obj, jint xPix, jint yPix) {
- browser_view_renderer_->ScrollTo(gfx::Vector2d(xPix, yPix));
+void AwContents::ScrollTo(JNIEnv* env, jobject obj, jint x, jint y) {
+ browser_view_renderer_->ScrollTo(gfx::Vector2d(x, y));
}
void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) {

Powered by Google App Engine
This is Rietveld 408576698