Commit 2e558efb authored by Richard Knoll's avatar Richard Knoll Committed by Commit Bot

Remove SharedClipboard menu entry from links.

Right clicking on a link should only show the "Send link" option, even
when there is selected text. We only want to show the "Copy to" option
when regular text is right clicked.

Bug: 1014054
Change-Id: I0c75b8b54de7259884c75edb4ff9709b4381c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1860336Reviewed-by: default avatarMichael van Ouwerkerk <mvanouwerkerk@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Richard Knoll <knollr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705979}
parent aa2265d3
...@@ -830,11 +830,6 @@ void RenderViewContextMenu::InitMenu() { ...@@ -830,11 +830,6 @@ void RenderViewContextMenu::InitMenu() {
// twice when you highlight a link of the form <a // twice when you highlight a link of the form <a
// href="tel:+9876543210">+9876543210</a> and right click on it. // href="tel:+9876543210">+9876543210</a> and right click on it.
MaybeAppendClickToCallItem(); MaybeAppendClickToCallItem();
// If this is a link, shared clipboard will be shown along with link items
// (AppendLinkItems), otherwise show it here beside the other sharing
// features.
if (params_.link_url.is_empty())
AppendSharedClipboardItems(); AppendSharedClipboardItems();
} }
bool media_image = content_type_->SupportsGroup( bool media_image = content_type_->SupportsGroup(
...@@ -1271,13 +1266,10 @@ void RenderViewContextMenu::AppendLinkItems() { ...@@ -1271,13 +1266,10 @@ void RenderViewContextMenu::AppendLinkItems() {
} }
} }
#endif // !defined(OS_CHROMEOS) #endif // !defined(OS_CHROMEOS)
AppendSharedClipboardItems();
if (browser && send_tab_to_self::ShouldOfferFeatureForLink( if (browser && send_tab_to_self::ShouldOfferFeatureForLink(
active_web_contents, params_.link_url)) { active_web_contents, params_.link_url)) {
send_tab_to_self::RecordSendTabToSelfClickResult( send_tab_to_self::RecordSendTabToSelfClickResult(
send_tab_to_self::kLinkMenu, SendTabToSelfClickResult::kShowItem); send_tab_to_self::kLinkMenu, SendTabToSelfClickResult::kShowItem);
// If Shared Clipboard is available don't add the separator.
if (!ShouldOfferSharedClipboard(browser_context_, params_.selection_text))
menu_model_.AddSeparator(ui::NORMAL_SEPARATOR); menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
if (send_tab_to_self::GetValidDeviceCount(GetBrowser()->profile()) == 1) { if (send_tab_to_self::GetValidDeviceCount(GetBrowser()->profile()) == 1) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
......
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