| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 const gfx::Vector2dF& scroll_offset, | 415 const gfx::Vector2dF& scroll_offset, |
| 416 float page_scale_factor, | 416 float page_scale_factor, |
| 417 const gfx::Vector2dF& page_scale_factor_limits, | 417 const gfx::Vector2dF& page_scale_factor_limits, |
| 418 const gfx::SizeF& content_size, | 418 const gfx::SizeF& content_size, |
| 419 const gfx::SizeF& viewport_size, | 419 const gfx::SizeF& viewport_size, |
| 420 const gfx::Vector2dF& controls_offset, | 420 const gfx::Vector2dF& controls_offset, |
| 421 const gfx::Vector2dF& content_offset, | 421 const gfx::Vector2dF& content_offset, |
| 422 bool is_mobile_optimized_hint) { | 422 bool is_mobile_optimized_hint) { |
| 423 JNIEnv* env = AttachCurrentThread(); | 423 JNIEnv* env = AttachCurrentThread(); |
| 424 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 424 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 425 if (obj.is_null()) | 425 if (obj.is_null() || !window_android_) |
| 426 return; | 426 return; |
| 427 | 427 |
| 428 window_android_->set_content_offset( | 428 window_android_->set_content_offset( |
| 429 gfx::ScaleVector2d(content_offset, dpi_scale_)); | 429 gfx::ScaleVector2d(content_offset, dpi_scale_)); |
| 430 | 430 |
| 431 page_scale_ = page_scale_factor; | 431 page_scale_ = page_scale_factor; |
| 432 | 432 |
| 433 Java_ContentViewCore_updateFrameInfo( | 433 Java_ContentViewCore_updateFrameInfo( |
| 434 env, obj.obj(), | 434 env, obj.obj(), |
| 435 scroll_offset.x(), | 435 scroll_offset.x(), |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1539 return ScopedJavaLocalRef<jobject>(); | 1539 return ScopedJavaLocalRef<jobject>(); |
| 1540 | 1540 |
| 1541 return view->GetJavaObject(); | 1541 return view->GetJavaObject(); |
| 1542 } | 1542 } |
| 1543 | 1543 |
| 1544 bool RegisterContentViewCore(JNIEnv* env) { | 1544 bool RegisterContentViewCore(JNIEnv* env) { |
| 1545 return RegisterNativesImpl(env); | 1545 return RegisterNativesImpl(env); |
| 1546 } | 1546 } |
| 1547 | 1547 |
| 1548 } // namespace content | 1548 } // namespace content |
| OLD | NEW |