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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java

Issue 1101743003: Put the screenshot URI in clipData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments Created 5 years, 8 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 | no next file » | 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/share/ShareHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java
index b747611853ca4c58332ee9bdbaff487eaf61d482..b71fcfcf2f9caa4a8acf2424d31750f074f0c9ad 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.share;
import android.app.Activity;
import android.app.AlertDialog;
+import android.content.ClipData;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -253,6 +254,10 @@ public class ShareHelper {
intent.putExtra(Intent.EXTRA_TEXT, url);
if (screenshotUri != null) {
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+ // To give read access to an Intent target, we need to put |screenshotUri| in clipData
+ // because adding Intent.FLAG_GRANT_READ_URI_PERMISSION doesn't work for
+ // EXTRA_SHARE_SCREENSHOT_AS_STREAM.
+ intent.setClipData(ClipData.newRawUri("", screenshotUri));
intent.putExtra(EXTRA_SHARE_SCREENSHOT_AS_STREAM, screenshotUri);
}
return intent;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698