Chromium Code Reviews| 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 f5151fa215c236921294a946d95afa6d4661da0d..e41d8f27d37bec19b2785e70eaa3d1149111b645 100644 |
| --- a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp |
| +++ b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp |
| @@ -402,6 +402,16 @@ bool ContextMenuClientImpl::ShowContextMenu(const ContextMenu* default_menu, |
| data.input_field_type = WebContextMenuData::kInputFieldTypeNone; |
| } |
| + if (data.selected_text.IsEmpty()) { |
|
aelias_OOO_until_Jul13
2017/05/11 21:16:17
Please push this logic down into FrameSelection::B
|
| + WebRect focus_webrect; |
| + WebRect anchor_webrect; |
| + web_view_->SelectionBounds(focus_webrect, anchor_webrect); |
| + data.selection_rect = focus_webrect; |
| + } else { |
| + data.selection_rect = selected_frame->View()->ContentsToViewport( |
| + web_view_->MainFrame()->SelectionBoundsRect()); |
| + } |
| + |
| if (from_touch && !ShouldShowContextMenuFromTouch(data)) |
| return false; |