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 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) { | 1323 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) { |
1324 JNIEnv* env = AttachCurrentThread(); | 1324 JNIEnv* env = AttachCurrentThread(); |
1325 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1325 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1326 if (obj.is_null()) | 1326 if (obj.is_null()) |
1327 return; | 1327 return; |
1328 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded( | 1328 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded( |
1329 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), | 1329 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), |
1330 static_cast<jint>(y_dip * dpi_scale())); | 1330 static_cast<jint>(y_dip * dpi_scale())); |
1331 } | 1331 } |
1332 | 1332 |
| 1333 void ContentViewCoreImpl::GenerateNewFrameForTesting() { |
| 1334 JNIEnv* env = AttachCurrentThread(); |
| 1335 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1336 if (obj.is_null()) |
| 1337 return; |
| 1338 Java_ContentViewCore_generateNewFrameForTesting(env, obj.obj()); |
| 1339 } |
| 1340 |
1333 void ContentViewCoreImpl::OnSmartClipDataExtracted( | 1341 void ContentViewCoreImpl::OnSmartClipDataExtracted( |
1334 const base::string16& text, | 1342 const base::string16& text, |
1335 const base::string16& html, | 1343 const base::string16& html, |
1336 const gfx::Rect& clip_rect) { | 1344 const gfx::Rect& clip_rect) { |
1337 JNIEnv* env = AttachCurrentThread(); | 1345 JNIEnv* env = AttachCurrentThread(); |
1338 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1346 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1339 if (obj.is_null()) | 1347 if (obj.is_null()) |
1340 return; | 1348 return; |
1341 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text); | 1349 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text); |
1342 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html); | 1350 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 return NULL; | 1389 return NULL; |
1382 | 1390 |
1383 return view->GetJavaObject().Release(); | 1391 return view->GetJavaObject().Release(); |
1384 } | 1392 } |
1385 | 1393 |
1386 bool RegisterContentViewCore(JNIEnv* env) { | 1394 bool RegisterContentViewCore(JNIEnv* env) { |
1387 return RegisterNativesImpl(env); | 1395 return RegisterNativesImpl(env); |
1388 } | 1396 } |
1389 | 1397 |
1390 } // namespace content | 1398 } // namespace content |
OLD | NEW |