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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 end_rect.y(), | 372 end_rect.y(), |
373 end_rect.right(), | 373 end_rect.right(), |
374 end_rect.bottom())); | 374 end_rect.bottom())); |
375 Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(), | 375 Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(), |
376 start_rect_object.obj(), | 376 start_rect_object.obj(), |
377 start_dir, | 377 start_dir, |
378 end_rect_object.obj(), | 378 end_rect_object.obj(), |
379 end_dir); | 379 end_dir); |
380 } | 380 } |
381 | 381 |
| 382 void ContentViewCoreImpl::ShowPastePopup(int x, int y) { |
| 383 JNIEnv* env = AttachCurrentThread(); |
| 384 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 385 if (obj.is_null()) |
| 386 return; |
| 387 Java_ContentViewCore_showPastePopup(env, obj.obj(), static_cast<jint>(x), |
| 388 static_cast<jint>(y)); |
| 389 } |
| 390 |
382 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { | 391 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |
383 JNIEnv* env = AttachCurrentThread(); | 392 JNIEnv* env = AttachCurrentThread(); |
384 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 393 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
385 if (j_obj.is_null()) | 394 if (j_obj.is_null()) |
386 return; | 395 return; |
387 ScopedJavaLocalRef<jstring> jcontent_url = | 396 ScopedJavaLocalRef<jstring> jcontent_url = |
388 ConvertUTF8ToJavaString(env, content_url.spec()); | 397 ConvertUTF8ToJavaString(env, content_url.spec()); |
389 Java_ContentViewCore_startContentIntent(env, | 398 Java_ContentViewCore_startContentIntent(env, |
390 j_obj.obj(), | 399 j_obj.obj(), |
391 jcontent_url.obj()); | 400 jcontent_url.obj()); |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 975 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
967 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 976 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
968 return false; | 977 return false; |
969 } | 978 } |
970 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 979 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
971 | 980 |
972 return RegisterNativesImpl(env) >= 0; | 981 return RegisterNativesImpl(env) >= 0; |
973 } | 982 } |
974 | 983 |
975 } // namespace content | 984 } // namespace content |
OLD | NEW |