Commit 9785cbfd authored by pkasting@chromium.org's avatar pkasting@chromium.org

When the user highlights all or part of a link, don't show "Go to <URL>" if...

When the user highlights all or part of a link, don't show "Go to <URL>" if that would navigate to the same place as the link itself, as this is redundant.

BUG=112768
TEST=Go to a bug with a link; highlight the link (or the link without "http://" and/or the trailing slash), right-click, verify there's no "go to" context menu item.
Review URL: https://chromiumcodereview.appspot.com/10536108

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141684 0039d316-1c4b-4281-b951-d872f2087c98
parent c90e84d0
......@@ -917,8 +917,9 @@ void RenderViewContextMenu::AppendSearchProvider() {
printable_selection_text.insert(i, 1, '&');
if (match.transition == content::PAGE_TRANSITION_TYPED) {
if (ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme(
selection_navigation_url_.scheme())) {
if ((selection_navigation_url_ != params_.link_url) &&
ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme(
selection_navigation_url_.scheme())) {
menu_model_.AddItem(
IDC_CONTENT_CONTEXT_GOTOURL,
l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_GOTOURL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment