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

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

Issue 2007213002: Fixing long press paste pop up bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..19a271738e1e20a5a61b2483d25f4a1b69102579 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 && data.selectedText.isEmpty());
aelias_OOO_until_Jul13 2016/05/24 23:53:16 Could you remove the check for isEmpty()? That se
amaralp 2016/05/25 00:18:43 I copied that check from chrome_web_contents_view_
}
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,6 +366,9 @@ 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())
aelias_OOO_until_Jul13 2016/05/24 23:53:16 Should've thought of this on the previous patch, b
amaralp 2016/05/25 00:18:43 Done.
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698