| 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 645 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 646 if (j_obj.is_null()) | 646 if (j_obj.is_null()) |
| 647 return; | 647 return; |
| 648 | 648 |
| 649 Java_ContentViewCore_onSelectionEvent( | 649 Java_ContentViewCore_onSelectionEvent( |
| 650 env, j_obj, event, selection_anchor.x(), selection_anchor.y(), | 650 env, j_obj, event, selection_anchor.x(), selection_anchor.y(), |
| 651 selection_rect.x(), selection_rect.y(), selection_rect.right(), | 651 selection_rect.x(), selection_rect.y(), selection_rect.right(), |
| 652 selection_rect.bottom()); | 652 selection_rect.bottom()); |
| 653 } | 653 } |
| 654 | 654 |
| 655 bool ContentViewCoreImpl::ShowPastePopup(int x_dip, int y_dip) { | 655 void ContentViewCoreImpl::ShowPastePopup(int x_dip, int y_dip) { |
| 656 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 656 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 657 if (!view) | 657 if (!view) |
| 658 return false; | 658 return; |
| 659 | 659 |
| 660 view->OnShowingPastePopup(gfx::PointF(x_dip, y_dip)); | 660 view->OnShowingPastePopup(gfx::PointF(x_dip, y_dip)); |
| 661 | 661 |
| 662 JNIEnv* env = AttachCurrentThread(); | 662 JNIEnv* env = AttachCurrentThread(); |
| 663 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 663 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 664 if (obj.is_null()) | 664 if (obj.is_null()) |
| 665 return false; | 665 return; |
| 666 return Java_ContentViewCore_showPastePopupWithFeedback(env, obj, x_dip, | 666 Java_ContentViewCore_showPastePopup(env, obj, x_dip, |
| 667 y_dip); | 667 y_dip); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url, | 670 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url, |
| 671 bool is_main_frame) { | 671 bool is_main_frame) { |
| 672 JNIEnv* env = AttachCurrentThread(); | 672 JNIEnv* env = AttachCurrentThread(); |
| 673 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 673 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 674 if (j_obj.is_null()) | 674 if (j_obj.is_null()) |
| 675 return; | 675 return; |
| 676 ScopedJavaLocalRef<jstring> jcontent_url = | 676 ScopedJavaLocalRef<jstring> jcontent_url = |
| 677 ConvertUTF8ToJavaString(env, content_url.spec()); | 677 ConvertUTF8ToJavaString(env, content_url.spec()); |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 return ScopedJavaLocalRef<jobject>(); | 1599 return ScopedJavaLocalRef<jobject>(); |
| 1600 | 1600 |
| 1601 return view->GetJavaObject(); | 1601 return view->GetJavaObject(); |
| 1602 } | 1602 } |
| 1603 | 1603 |
| 1604 bool RegisterContentViewCore(JNIEnv* env) { | 1604 bool RegisterContentViewCore(JNIEnv* env) { |
| 1605 return RegisterNativesImpl(env); | 1605 return RegisterNativesImpl(env); |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 } // namespace content | 1608 } // namespace content |
| OLD | NEW |