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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 return false; | 587 return false; |
588 | 588 |
589 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 589 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
590 if (!view) | 590 if (!view) |
591 return false; | 591 return false; |
592 | 592 |
593 JNIEnv* env = AttachCurrentThread(); | 593 JNIEnv* env = AttachCurrentThread(); |
594 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 594 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
595 if (obj.is_null()) | 595 if (obj.is_null()) |
596 return false; | 596 return false; |
| 597 |
597 const bool can_select_all = | 598 const bool can_select_all = |
598 !!(params.edit_flags & WebContextMenuData::kCanSelectAll); | 599 !!(params.edit_flags & WebContextMenuData::kCanSelectAll); |
| 600 const bool can_edit_richly = |
| 601 !!(params.edit_flags & blink::WebContextMenuData::kCanEditRichly); |
| 602 |
599 Java_ContentViewCore_showPastePopup(env, obj, params.selection_start.x(), | 603 Java_ContentViewCore_showPastePopup(env, obj, params.selection_start.x(), |
600 params.selection_start.y(), | 604 params.selection_start.y(), |
601 can_select_all); | 605 can_select_all, can_edit_richly); |
602 return true; | 606 return true; |
603 } | 607 } |
604 | 608 |
605 void ContentViewCoreImpl::ShowDisambiguationPopup( | 609 void ContentViewCoreImpl::ShowDisambiguationPopup( |
606 const gfx::Rect& rect_pixels, | 610 const gfx::Rect& rect_pixels, |
607 const SkBitmap& zoomed_bitmap) { | 611 const SkBitmap& zoomed_bitmap) { |
608 JNIEnv* env = AttachCurrentThread(); | 612 JNIEnv* env = AttachCurrentThread(); |
609 | 613 |
610 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 614 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
611 if (obj.is_null()) | 615 if (obj.is_null()) |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 return ScopedJavaLocalRef<jobject>(); | 1279 return ScopedJavaLocalRef<jobject>(); |
1276 | 1280 |
1277 return view->GetJavaObject(); | 1281 return view->GetJavaObject(); |
1278 } | 1282 } |
1279 | 1283 |
1280 bool RegisterContentViewCore(JNIEnv* env) { | 1284 bool RegisterContentViewCore(JNIEnv* env) { |
1281 return RegisterNativesImpl(env); | 1285 return RegisterNativesImpl(env); |
1282 } | 1286 } |
1283 | 1287 |
1284 } // namespace content | 1288 } // namespace content |
OLD | NEW |