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 43517e24470429a41096b98c66e6d34a307e77e7..e8a64229c3a874b6594085c8df1a10391cc8f9d5 100644 |
| --- a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp |
| +++ b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp |
| @@ -135,7 +135,8 @@ static bool shouldShowContextMenuFromTouch(const WebContextMenuData& data) |
| { |
| return !data.linkURL.isEmpty() |
| || data.mediaType == WebContextMenuData::MediaTypeImage |
| - || data.mediaType == WebContextMenuData::MediaTypeVideo; |
| + || data.mediaType == WebContextMenuData::MediaTypeVideo |
| + || data.isEditable; |
| } |
| bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu, bool fromTouch) |
| @@ -263,9 +264,6 @@ bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu, bool |
| } |
| } |
| - if (fromTouch && !shouldShowContextMenuFromTouch(data)) |
| - return false; |
| - |
| // If it's not a link, an image, a media element, or an image/media link, |
| // show a selection menu or a more generic page menu. |
| if (selectedFrame->document()->loader()) |
| @@ -368,12 +366,17 @@ bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu, bool |
| data.inputFieldType = WebContextMenuData::InputFieldTypeNone; |
| } |
| + if (fromTouch && !shouldShowContextMenuFromTouch(data)) |
| + return false; |
| + |
| WebLocalFrameImpl* selectedWebFrame = WebLocalFrameImpl::fromFrame(selectedFrame); |
| selectedWebFrame->setContextMenuNode(r.innerNodeOrImageMapImage()); |
| - if (selectedWebFrame->client()) |
| + if (selectedWebFrame->client()) { |
| selectedWebFrame->client()->showContextMenu(data); |
| + return true; |
|
aelias_OOO_until_Jul13
2016/05/25 01:08:32
Nit: in Blink style, it's generally preferred for
|
| + } |
| - return true; |
| + return false; |
| } |
| void ContextMenuClientImpl::clearContextMenu() |