Commit 1e6cd70c authored by Yasmin's avatar Yasmin Committed by Commit Bot

Reposition Send Text to be shown on top of Send Link when both options are available.

Screenshots of the result:
With Send Link: https://i.imgur.com/IaIgrmC.png
Without Send Link: https://i.imgur.com/JlyILgV.png

Bug: 1000025
Change-Id: I73d267a7f9d19b749b5f666532f39886f8a856f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778874
Commit-Queue: Yasmin Molazadeh <yasmo@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693106}
parent 7c1b2898
...@@ -866,7 +866,10 @@ void RenderViewContextMenu::InitMenu() { ...@@ -866,7 +866,10 @@ void RenderViewContextMenu::InitMenu() {
// Add shared clipboard menu item and copy items. // Add shared clipboard menu item and copy items.
if (content_type_->SupportsGroup(ContextMenuContentType::ITEM_GROUP_COPY)) { if (content_type_->SupportsGroup(ContextMenuContentType::ITEM_GROUP_COPY)) {
DCHECK(!editable); DCHECK(!editable);
AppendSharedClipboardItems(); // If this is a link, shared clipboard will be shown along with link items
// (AppendLinkItems), otherwise show it here along with copy items.
if (params_.link_url.is_empty())
AppendSharedClipboardItems();
AppendCopyItem(); AppendCopyItem();
} }
...@@ -1262,11 +1265,14 @@ void RenderViewContextMenu::AppendLinkItems() { ...@@ -1262,11 +1265,14 @@ 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);
menu_model_.AddSeparator(ui::NORMAL_SEPARATOR); // If Shared Clipboard is available don't add the separator.
if (!ShouldOfferSharedClipboard(browser_context_, params_.selection_text))
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)
menu_model_.AddItem(IDC_CONTENT_LINK_SEND_TAB_TO_SELF_SINGLE_TARGET, menu_model_.AddItem(IDC_CONTENT_LINK_SEND_TAB_TO_SELF_SINGLE_TARGET,
......
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