Index: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java |
index 0cdd16fe1a379febe06a07653e948a607b643260..25d03507c2d79a912cf1dadb8898910d3e08785a 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java |
@@ -5,6 +5,7 @@ |
package org.chromium.chrome.browser.contextmenu; |
import android.content.Context; |
+import android.net.MailTo; |
import android.os.Build; |
import android.text.TextUtils; |
import android.view.ContextMenu; |
@@ -58,6 +59,12 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { |
menu.findItem(R.id.contextmenu_copy_link_text).setVisible(false); |
} |
+ if (MailTo.isMailTo(params.getLinkUrl())) { |
+ menu.findItem(R.id.contextmenu_copy_link_address_text).setVisible(false); |
+ } else { |
+ menu.findItem(R.id.contextmenu_copy_email_address).setVisible(false); |
+ } |
+ |
menu.findItem(R.id.contextmenu_save_link_as).setVisible( |
UrlUtilities.isDownloadableScheme(params.getLinkUrl())); |
@@ -111,6 +118,8 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { |
mDelegate.onOpenImageInNewTab(params.getSrcUrl(), params.getReferrer()); |
} else if (itemId == R.id.contextmenu_copy_link_address_text) { |
mDelegate.onSaveToClipboard(params.getUnfilteredLinkUrl(), true); |
+ } else if (itemId == R.id.contextmenu_copy_email_address) { |
+ mDelegate.onSaveToClipboard(MailTo.parse(params.getLinkUrl()).getTo(), false); |
} else if (itemId == R.id.contextmenu_copy_link_text) { |
mDelegate.onSaveToClipboard(params.getLinkText(), false); |
} else if (itemId == R.id.contextmenu_save_image || |