| 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 JNIEnv* env = AttachCurrentThread(); | 594 JNIEnv* env = AttachCurrentThread(); |
| 595 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 595 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 596 if (obj.is_null()) | 596 if (obj.is_null()) |
| 597 return false; | 597 return false; |
| 598 | 598 |
| 599 const bool can_select_all = | 599 const bool can_select_all = |
| 600 !!(params.edit_flags & WebContextMenuData::kCanSelectAll); | 600 !!(params.edit_flags & WebContextMenuData::kCanSelectAll); |
| 601 const bool can_edit_richly = | 601 const bool can_edit_richly = |
| 602 !!(params.edit_flags & blink::WebContextMenuData::kCanEditRichly); | 602 !!(params.edit_flags & blink::WebContextMenuData::kCanEditRichly); |
| 603 | 603 |
| 604 Java_ContentViewCore_showPastePopup(env, obj, params.selection_start.x(), | 604 int handle_height = GetRenderWidgetHostViewAndroid()->GetTouchHandleHeight(); |
| 605 params.selection_start.y(), | 605 Java_ContentViewCore_showPastePopup( |
| 606 can_select_all, can_edit_richly); | 606 env, obj, params.selection_rect.x(), params.selection_rect.y(), |
| 607 params.selection_rect.right(), |
| 608 params.selection_rect.bottom() + handle_height, can_select_all, |
| 609 can_edit_richly); |
| 607 return true; | 610 return true; |
| 608 } | 611 } |
| 609 | 612 |
| 610 void ContentViewCoreImpl::ShowDisambiguationPopup( | 613 void ContentViewCoreImpl::ShowDisambiguationPopup( |
| 611 const gfx::Rect& rect_pixels, | 614 const gfx::Rect& rect_pixels, |
| 612 const SkBitmap& zoomed_bitmap) { | 615 const SkBitmap& zoomed_bitmap) { |
| 613 JNIEnv* env = AttachCurrentThread(); | 616 JNIEnv* env = AttachCurrentThread(); |
| 614 | 617 |
| 615 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 618 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 616 if (obj.is_null()) | 619 if (obj.is_null()) |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 return ScopedJavaLocalRef<jobject>(); | 1283 return ScopedJavaLocalRef<jobject>(); |
| 1281 | 1284 |
| 1282 return view->GetJavaObject(); | 1285 return view->GetJavaObject(); |
| 1283 } | 1286 } |
| 1284 | 1287 |
| 1285 bool RegisterContentViewCore(JNIEnv* env) { | 1288 bool RegisterContentViewCore(JNIEnv* env) { |
| 1286 return RegisterNativesImpl(env); | 1289 return RegisterNativesImpl(env); |
| 1287 } | 1290 } |
| 1288 | 1291 |
| 1289 } // namespace content | 1292 } // namespace content |
| OLD | NEW |