Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java

Issue 2775373002: Add a Share Icon to Tabular Context Menu (Closed)
Patch Set: Fixes based off twellington's comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuListAdapter.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
index 95c47d8775ed819f3e3912cbef5d539021888d12..efcaef0eab53c771206059bfa7d8cd626d1afc40 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.contextmenu;
import android.app.Activity;
+import android.content.ComponentName;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Pair;
@@ -39,6 +40,7 @@ public class ContextMenuHelper implements OnCreateContextMenuListener {
private Runnable mOnMenuShown;
private Runnable mOnMenuClosed;
private OnThumbnailReceivedListener mOnThumbnailReceivedListener;
+ private ComponentName mComponentName;
interface OnThumbnailReceivedListener {
void onThumbnailReceived(Bitmap bitmap);
@@ -167,7 +169,19 @@ public class ContextMenuHelper implements OnCreateContextMenuListener {
Activity activity = windowAndroid.getActivity().get();
if (activity == null) return;
- ShareHelper.shareImage(activity, jpegImageData);
+ ShareHelper.shareImage(activity, jpegImageData, mComponentName);
+ // This needs to be reset to null after a share. This way the next time a user shares an
+ // image it won't share with the last shared item unless explicitly told.
David Trainor- moved to gerrit 2017/03/30 23:50:22 item -> app?
JJ 2017/03/31 20:58:54 Done.
+ mComponentName = null;
+ }
+
+ /**
+ * Share image triggered with the current context menu directly with a specific app.
+ * @param name The app to share the image directly with.
+ */
+ public void shareImageDirectly(ComponentName name) {
+ mComponentName = name;
+ shareImage();
}
/**
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuListAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698