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

Unified Diff: android_webview/native/aw_contents.cc

Issue 16255010: Hookup android_webview scroll offset delegation to Java side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 7 years, 6 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 8d726da2afbd400a57ef2123a8eca18634835f8a..bc9704fc8fd30c7f7fcafb18f28ec9f2d33f92a0 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -649,19 +649,20 @@ bool AwContents::OnDraw(JNIEnv* env,
jobject obj,
jobject canvas,
jboolean is_hardware_accelerated,
- jint scroll_x,
- jint scroll_y,
+ jint scroll_x_pix,
+ jint scroll_y_pix,
jint clip_left,
jint clip_top,
jint clip_right,
jint clip_bottom) {
- return browser_view_renderer_->OnDraw(canvas,
- is_hardware_accelerated,
- gfx::Point(scroll_x, scroll_y),
- gfx::Rect(clip_left,
- clip_top,
- clip_right - clip_left,
- clip_bottom - clip_top));
+ return browser_view_renderer_->OnDraw(
+ canvas,
+ is_hardware_accelerated,
+ gfx::Vector2d(scroll_x_pix, scroll_y_pix),
+ gfx::Rect(clip_left,
+ clip_top,
+ clip_right - clip_left,
+ clip_bottom - clip_top));
}
void AwContents::SetPendingWebContentsForPopup(
@@ -697,6 +698,19 @@ gfx::Point AwContents::GetLocationOnScreen() {
return gfx::Point(location[0], location[1]);
}
+void AwContents::ScrollContainerViewTo(gfx::Vector2dF new_value_css) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return;
+ Java_AwContents_scrollContainerViewTo(
+ env, obj.obj(), new_value_css.x(), new_value_css.y());
+}
+
+void AwContents::ScrollTo(JNIEnv* env, jobject obj, jint x, jint y) {
+ browser_view_renderer_->ScrollTo(gfx::Vector2dF(x, y));
+}
+
void AwContents::OnPageScaleFactorChanged(float page_scale_factor) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);

Powered by Google App Engine
This is Rietveld 408576698