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

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

Issue 972293003: Refactor codes to run only the bitmap converting logic in background (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 5fcad3e7556c5490d9826ae85f0434bf5c183333..e4a2c70c512ead73a41ddfe7b6a5dec7fb776787 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
@@ -48,6 +48,7 @@ public class ShareHelper {
private static final String PACKAGE_NAME_KEY = "last_shared_package_name";
private static final String CLASS_NAME_KEY = "last_shared_class_name";
+ private static final String EXTRA_RAW_FILE_PATH = "raw-file-path";
/**
* Directory name for screenshots.
@@ -180,6 +181,12 @@ public class ShareHelper {
protected void onPostExecute(Intent intent) {
if (ApplicationStatus.getStateForApplication()
!= ApplicationState.HAS_DESTROYED_ACTIVITIES) {
+ String rawFilePath = intent.getStringExtra(EXTRA_RAW_FILE_PATH);
+ if (rawFilePath != null) {
+ intent.putExtra(Intent.EXTRA_STREAM, UiUtils.getUriForImageCaptureFile(
+ activity, new File(rawFilePath)));
+ intent.removeExtra(EXTRA_RAW_FILE_PATH);
+ }
activity.startActivity(intent);
}
}
@@ -239,8 +246,7 @@ public class ShareHelper {
fOut.close();
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- intent.putExtra(Intent.EXTRA_STREAM,
- UiUtils.getUriForImageCaptureFile(context, saveFile));
+ intent.putExtra(EXTRA_RAW_FILE_PATH, saveFile.getAbsolutePath());
Ted C 2015/03/04 00:09:57 Hmm...I don't really like that we have to muck wit
Jaekyun Seok (inactive) 2015/03/04 00:39:13 Done.
}
} catch (IOException ie) {
if (fOut != null) {
« 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