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

Unified Diff: third_party/WebKit/Source/web/ContextMenuClientImpl.cpp

Issue 2855353002: Make Paste Popup use selection rect for positioning (Closed)
Patch Set: Created 3 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: third_party/WebKit/Source/web/ContextMenuClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp
index 63214655706a8c3468d99ef8c4ad55f781be68cd..6afec50f940a8eeda4538ba95a5e8ff38cfa3099 100644
--- a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp
@@ -402,6 +402,13 @@ bool ContextMenuClientImpl::ShowContextMenu(const ContextMenu* default_menu,
data.input_field_type = WebContextMenuData::kInputFieldTypeNone;
}
+ WebRect focus_webrect;
+ WebRect anchor_webrect;
+ web_view_->SelectionBounds(focus_webrect, anchor_webrect);
+ data.selection_rect = WebRect(focus_webrect.x, focus_webrect.y,
+ anchor_webrect.x + anchor_webrect.width,
aelias_OOO_until_Jul13 2017/05/04 20:48:56 C++ rects have different format from Java Rects, s
amaralp 2017/05/05 01:14:32 Done, also fixed an issue when anchor comes before
+ anchor_webrect.y + anchor_webrect.height);
+
if (from_touch && !ShouldShowContextMenuFromTouch(data))
return false;

Powered by Google App Engine
This is Rietveld 408576698