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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java

Issue 2669243007: [Downloads] Use content:// URIs in more places (Closed)
Patch Set: Rebased Created 3 years, 11 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/customtabs/CustomTabIntentDataProvider.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/customtabs/CustomTabActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index 199e49d24ed01201cae11219fdc0971d59360327..f0f21ae98cdb15a2471b9338f27ca5185b1a84a0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -992,9 +992,23 @@ public class CustomTabActivity extends ChromeActivity {
*/
private String getUrlToLoad() {
String url = IntentHandler.getUrlFromIntent(getIntent());
+
+ // Intents fired for media viewers have an additional file:// URI passed along so that the
+ // tab can display the actual filename to the user when it is loaded.
+ if (mIntentDataProvider.isMediaViewer()) {
+ String mediaViewerUrl = mIntentDataProvider.getMediaViewerUrl();
+ if (!TextUtils.isEmpty(mediaViewerUrl)) {
+ Uri mediaViewerUri = Uri.parse(mediaViewerUrl);
+ if ("file".equals(mediaViewerUri.getScheme())) {
+ url = mediaViewerUrl;
+ }
+ }
+ }
+
if (!TextUtils.isEmpty(url)) {
url = DataReductionProxySettings.getInstance().maybeRewriteWebliteUrl(url);
}
+
return url;
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698