| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 void ContentViewCoreImpl::UpdateScrollOffsetAndPageScaleFactor(int x, int y, | 382 void ContentViewCoreImpl::UpdateScrollOffsetAndPageScaleFactor(int x, int y, |
| 383 float scale) { | 383 float scale) { |
| 384 JNIEnv* env = AttachCurrentThread(); | 384 JNIEnv* env = AttachCurrentThread(); |
| 385 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 385 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 386 if (obj.is_null()) | 386 if (obj.is_null()) |
| 387 return; | 387 return; |
| 388 Java_ContentViewCore_updateScrollOffsetAndPageScaleFactor(env, obj.obj(), x, | 388 Java_ContentViewCore_updateScrollOffsetAndPageScaleFactor(env, obj.obj(), x, |
| 389 y, scale); | 389 y, scale); |
| 390 } | 390 } |
| 391 | 391 |
| 392 void ContentViewCoreImpl::UpdateUnusedScrollOffset(int x, int y) { |
| 393 JNIEnv* env = AttachCurrentThread(); |
| 394 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 395 if (obj.is_null()) |
| 396 return; |
| 397 Java_ContentViewCore_updateUnusedScrollOffset(env, obj.obj(), x, y); |
| 398 } |
| 399 |
| 392 void ContentViewCoreImpl::UpdatePageScaleLimits(float minimum_scale, | 400 void ContentViewCoreImpl::UpdatePageScaleLimits(float minimum_scale, |
| 393 float maximum_scale) { | 401 float maximum_scale) { |
| 394 JNIEnv* env = AttachCurrentThread(); | 402 JNIEnv* env = AttachCurrentThread(); |
| 395 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 403 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 396 if (obj.is_null()) | 404 if (obj.is_null()) |
| 397 return; | 405 return; |
| 398 Java_ContentViewCore_updatePageScaleLimits(env, obj.obj(), minimum_scale, | 406 Java_ContentViewCore_updatePageScaleLimits(env, obj.obj(), minimum_scale, |
| 399 maximum_scale); | 407 maximum_scale); |
| 400 } | 408 } |
| 401 | 409 |
| (...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 1390 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
| 1383 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 1391 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
| 1384 return false; | 1392 return false; |
| 1385 } | 1393 } |
| 1386 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 1394 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
| 1387 | 1395 |
| 1388 return RegisterNativesImpl(env) >= 0; | 1396 return RegisterNativesImpl(env) >= 0; |
| 1389 } | 1397 } |
| 1390 | 1398 |
| 1391 } // namespace content | 1399 } // namespace content |
| OLD | NEW |