| Index: chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
| index bdd0ce8285a13bf88e683235e0128b310434e607..2dafc1ba443050e38de3943b9c007c22c5efc5e7 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
| @@ -6,7 +6,9 @@ package org.chromium.chrome.browser.tab;
|
|
|
| import android.content.Context;
|
| import android.content.Intent;
|
| +import android.net.MailTo;
|
| import android.net.Uri;
|
| +import android.provider.ContactsContract;
|
|
|
| import org.chromium.base.metrics.RecordUserAction;
|
| import org.chromium.chrome.browser.IntentHandler;
|
| @@ -17,6 +19,7 @@ import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
|
| import org.chromium.chrome.browser.preferences.PrefServiceBridge;
|
| import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
|
| import org.chromium.chrome.browser.tabmodel.document.TabDelegate;
|
| +import org.chromium.chrome.browser.util.IntentUtils;
|
| import org.chromium.chrome.browser.util.UrlUtilities;
|
| import org.chromium.content_public.browser.LoadUrlParams;
|
| import org.chromium.content_public.common.Referrer;
|
| @@ -75,6 +78,38 @@ public class TabContextMenuItemDelegate implements ContextMenuItemDelegate {
|
| }
|
|
|
| @Override
|
| + public boolean supportsSendEmailMessage() {
|
| + Intent intent = new Intent(Intent.ACTION_VIEW);
|
| + intent.setData(Uri.parse("mailto:test@example.com"));
|
| + return mTab.getWindowAndroid().canResolveActivity(intent);
|
| + }
|
| +
|
| + @Override
|
| + public void onSendEmailMessage(String url) {
|
| + Intent intent = new Intent(Intent.ACTION_VIEW);
|
| + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
| + intent.setData(Uri.parse(url));
|
| + IntentUtils.safeStartActivity(mTab.getActivity(), intent);
|
| + }
|
| +
|
| + @Override
|
| + public boolean supportsAddToContacts() {
|
| + Intent intent = new Intent(Intent.ACTION_INSERT);
|
| + intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
|
| + return mTab.getWindowAndroid().canResolveActivity(intent);
|
| + }
|
| +
|
| + @Override
|
| + public void onAddToContacts(String url) {
|
| + Intent intent = new Intent(Intent.ACTION_INSERT);
|
| + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
| + intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
|
| + intent.putExtra(
|
| + ContactsContract.Intents.Insert.EMAIL, MailTo.parse(url).getTo().split(",")[0]);
|
| + IntentUtils.safeStartActivity(mTab.getActivity(), intent);
|
| + }
|
| +
|
| + @Override
|
| public void onOpenInOtherWindow(String url, Referrer referrer) {
|
| TabDelegate tabDelegate = new TabDelegate(mTab.isIncognito());
|
| LoadUrlParams loadUrlParams = new LoadUrlParams(url);
|
| @@ -184,4 +219,5 @@ public class TabContextMenuItemDelegate implements ContextMenuItemDelegate {
|
| }
|
| return false;
|
| }
|
| +
|
| }
|
|
|