Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 2855353002: Make Paste Popup use selection rect for positioning (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 Java_ContentViewCore_showPastePopup(
605 params.selection_start.y(), 605 env, obj, params.selection_rect.x(), params.selection_rect.y(),
606 can_select_all, can_edit_richly); 606 params.selection_rect.right(), params.selection_rect.bottom(),
607 can_select_all, can_edit_richly);
607 return true; 608 return true;
608 } 609 }
609 610
610 void ContentViewCoreImpl::ShowDisambiguationPopup( 611 void ContentViewCoreImpl::ShowDisambiguationPopup(
611 const gfx::Rect& rect_pixels, 612 const gfx::Rect& rect_pixels,
612 const SkBitmap& zoomed_bitmap) { 613 const SkBitmap& zoomed_bitmap) {
613 JNIEnv* env = AttachCurrentThread(); 614 JNIEnv* env = AttachCurrentThread();
614 615
615 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 616 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
616 if (obj.is_null()) 617 if (obj.is_null())
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 return ScopedJavaLocalRef<jobject>(); 1281 return ScopedJavaLocalRef<jobject>();
1281 1282
1282 return view->GetJavaObject(); 1283 return view->GetJavaObject();
1283 } 1284 }
1284 1285
1285 bool RegisterContentViewCore(JNIEnv* env) { 1286 bool RegisterContentViewCore(JNIEnv* env) {
1286 return RegisterNativesImpl(env); 1287 return RegisterNativesImpl(env);
1287 } 1288 }
1288 1289
1289 } // namespace content 1290 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698