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

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: fix compile break 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 333f8dc0313bc25e54dfef22450eba2e2223c834..dae81ebd878386c1896a30371fddecb6ea75ee25 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -636,7 +636,7 @@ bool AwContents::OnDraw(JNIEnv* env,
jint clip_bottom) {
return browser_view_renderer_->OnDraw(canvas,
is_hardware_accelerated,
- gfx::Point(scroll_x, scroll_y),
+ gfx::Vector2d(scroll_x, scroll_y),
gfx::Rect(clip_left,
clip_top,
clip_right - clip_left,
@@ -676,6 +676,24 @@ gfx::Point AwContents::GetLocationOnScreen() {
return gfx::Point(location[0], location[1]);
}
+void AwContents::ScrollContainerViewTo(gfx::Vector2d new_value) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return;
+ Java_AwContents_scrollContainerViewTo(
+ env, obj.obj(), new_value.x(), new_value.y());
+}
+
+
+void AwContents::SetDipScale(JNIEnv* env, jobject obj, jfloat dipScale) {
+ browser_view_renderer_->SetDipScale(dipScale);
+}
+
+void AwContents::ScrollTo(JNIEnv* env, jobject obj, jint xPix, jint yPix) {
+ browser_view_renderer_->ScrollTo(gfx::Vector2d(xPix, yPix));
+}
+
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