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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 1066053002: [Android] Allow custom ActionMode creation via ContentViewClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null check Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 0202db020c1bd4247b32659329c108ae90eb82ac..a7bcaecdef1ae181fb5a91fff2922cbc0b79b05f 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -609,14 +609,20 @@ void ContentViewCoreImpl::OnSelectionChanged(const std::string& text) {
}
void ContentViewCoreImpl::OnSelectionEvent(ui::SelectionEventType event,
- const gfx::PointF& position) {
+ const gfx::PointF& selection_anchor,
+ const gfx::RectF& selection_rect) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
if (j_obj.is_null())
return;
- Java_ContentViewCore_onSelectionEvent(env, j_obj.obj(), event,
- position.x() * dpi_scale(),
- position.y() * dpi_scale());
+
+ gfx::PointF selection_anchor_pix =
+ gfx::ScalePoint(selection_anchor, dpi_scale());
+ gfx::RectF selection_rect_pix = gfx::ScaleRect(selection_rect, dpi_scale());
+ Java_ContentViewCore_onSelectionEvent(
+ env, j_obj.obj(), event, selection_anchor_pix.x(),
+ selection_anchor_pix.y(), selection_rect_pix.x(), selection_rect_pix.y(),
+ selection_rect_pix.right(), selection_rect_pix.bottom());
}
scoped_ptr<ui::TouchHandleDrawable>
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698