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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 if (obj.is_null()) { | 605 if (obj.is_null()) { |
606 NOTREACHED(); | 606 NOTREACHED(); |
607 return scoped_ptr<TouchHandleDrawable>(); | 607 return scoped_ptr<TouchHandleDrawable>(); |
608 } | 608 } |
609 return scoped_ptr<TouchHandleDrawable>(new PopupTouchHandleDrawable( | 609 return scoped_ptr<TouchHandleDrawable>(new PopupTouchHandleDrawable( |
610 Java_ContentViewCore_createPopupTouchHandleDrawable(env, obj.obj()), | 610 Java_ContentViewCore_createPopupTouchHandleDrawable(env, obj.obj()), |
611 dpi_scale_)); | 611 dpi_scale_)); |
612 } | 612 } |
613 | 613 |
614 void ContentViewCoreImpl::ShowPastePopup(int x_dip, int y_dip) { | 614 void ContentViewCoreImpl::ShowPastePopup(int x_dip, int y_dip) { |
| 615 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 616 if (!view) |
| 617 return; |
| 618 |
| 619 view->OnShowingPastePopup(gfx::PointF(x_dip, y_dip)); |
| 620 |
615 JNIEnv* env = AttachCurrentThread(); | 621 JNIEnv* env = AttachCurrentThread(); |
616 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 622 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
617 if (obj.is_null()) | 623 if (obj.is_null()) |
618 return; | 624 return; |
619 Java_ContentViewCore_showPastePopup(env, obj.obj(), | 625 Java_ContentViewCore_showPastePopup(env, obj.obj(), |
620 static_cast<jint>(x_dip), | 626 static_cast<jint>(x_dip), |
621 static_cast<jint>(y_dip)); | 627 static_cast<jint>(y_dip)); |
622 } | 628 } |
623 | 629 |
624 void ContentViewCoreImpl::GetScaledContentBitmap( | 630 void ContentViewCoreImpl::GetScaledContentBitmap( |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1643 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1638 retained_objects_set); | 1644 retained_objects_set); |
1639 return reinterpret_cast<intptr_t>(view); | 1645 return reinterpret_cast<intptr_t>(view); |
1640 } | 1646 } |
1641 | 1647 |
1642 bool RegisterContentViewCore(JNIEnv* env) { | 1648 bool RegisterContentViewCore(JNIEnv* env) { |
1643 return RegisterNativesImpl(env); | 1649 return RegisterNativesImpl(env); |
1644 } | 1650 } |
1645 | 1651 |
1646 } // namespace content | 1652 } // namespace content |
OLD | NEW |