| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 const gfx::SizeF& viewport_size, | 386 const gfx::SizeF& viewport_size, |
| 387 const gfx::Vector2dF& controls_offset, | 387 const gfx::Vector2dF& controls_offset, |
| 388 const gfx::Vector2dF& content_offset, | 388 const gfx::Vector2dF& content_offset, |
| 389 float overdraw_bottom_height) { | 389 float overdraw_bottom_height) { |
| 390 JNIEnv* env = AttachCurrentThread(); | 390 JNIEnv* env = AttachCurrentThread(); |
| 391 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 391 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 392 if (obj.is_null()) | 392 if (obj.is_null()) |
| 393 return; | 393 return; |
| 394 | 394 |
| 395 if (window_android_) { | 395 if (window_android_) { |
| 396 gfx::Vector2dF window_offset( | |
| 397 Java_ContentViewCore_getLocationInWindowX(env, obj.obj()), | |
| 398 Java_ContentViewCore_getLocationInWindowY(env, obj.obj())); | |
| 399 window_android_->set_content_offset( | 396 window_android_->set_content_offset( |
| 400 gfx::ScaleVector2d(content_offset, dpi_scale_) + window_offset); | 397 gfx::ScaleVector2d(content_offset, dpi_scale_)); |
| 401 } | 398 } |
| 402 | 399 |
| 403 Java_ContentViewCore_updateFrameInfo( | 400 Java_ContentViewCore_updateFrameInfo( |
| 404 env, obj.obj(), | 401 env, obj.obj(), |
| 405 scroll_offset.x(), | 402 scroll_offset.x(), |
| 406 scroll_offset.y(), | 403 scroll_offset.y(), |
| 407 page_scale_factor, | 404 page_scale_factor, |
| 408 page_scale_factor_limits.x(), | 405 page_scale_factor_limits.x(), |
| 409 page_scale_factor_limits.y(), | 406 page_scale_factor_limits.y(), |
| 410 content_size.width(), | 407 content_size.width(), |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1601 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1605 retained_objects_set); | 1602 retained_objects_set); |
| 1606 return reinterpret_cast<intptr_t>(view); | 1603 return reinterpret_cast<intptr_t>(view); |
| 1607 } | 1604 } |
| 1608 | 1605 |
| 1609 bool RegisterContentViewCore(JNIEnv* env) { | 1606 bool RegisterContentViewCore(JNIEnv* env) { |
| 1610 return RegisterNativesImpl(env); | 1607 return RegisterNativesImpl(env); |
| 1611 } | 1608 } |
| 1612 | 1609 |
| 1613 } // namespace content | 1610 } // namespace content |
| OLD | NEW |