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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 17440004: Fix the problem that wrong context menu shows up when right clicking a link on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 7 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_context_menu.cc
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 608688f81e8b17ad7b18ef6d44c961b2968f87d9..340790b12b46d4104a76854104f37d291821b225 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -724,12 +724,15 @@ void RenderViewContextMenu::AppendPanelItems() {
bool has_selection = !params_.selection_text.empty();
+ // Checking link should take precedence before checking selection since on Mac
+ // right-clicking a link will also make it selected.
+ if (params_.unfiltered_link_url.is_valid())
+ AppendLinkItems();
+
if (params_.is_editable)
AppendEditableItems();
else if (has_selection)
AppendCopyItem();
- else if (params_.unfiltered_link_url.is_valid())
- AppendLinkItems();
// Only add extension items from this extension.
int index = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698