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

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

Issue 2671573002: [Downloads] Use content:// URIs in more places (Closed)
Patch Set: 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
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
index abc157680d01caa7060be94929779ae259753cd1..d8d3459689e9423ad5f9ab5aee33083785e786ff 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -58,6 +58,10 @@ public class CustomTabIntentDataProvider {
public static final String EXTRA_IS_MEDIA_VIEWER =
"org.chromium.chrome.browser.customtabs.IS_MEDIA_VIEWER";
+ /** URL that should be loaded in place of the URL passed along in the data. */
+ public static final String EXTRA_MEDIA_VIEWER_URL =
+ "org.chromium.chrome.browser.customtabs.MEDIA_VIEWER_URL";
+
/** Indicates that the Custom Tab should style itself as an info page. */
public static final String EXTRA_IS_INFO_PAGE =
"org.chromium.chrome.browser.customtabs.IS_INFO_PAGE";
@@ -93,6 +97,7 @@ public class CustomTabIntentDataProvider {
private final Intent mKeepAliveServiceIntent;
private final int mTitleVisibilityState;
private final boolean mIsMediaViewer;
+ private final String mMediaViewerUrl;
private final boolean mIsInfoPage;
private final int mInitialBackgroundColor;
private final boolean mDisableStar;
@@ -178,6 +183,8 @@ public class CustomTabIntentDataProvider {
CustomTabsIntent.EXTRA_REMOTEVIEWS_PENDINGINTENT);
mIsMediaViewer = mIsTrustedIntent
&& IntentUtils.safeGetBooleanExtra(intent, EXTRA_IS_MEDIA_VIEWER, false);
+ mMediaViewerUrl = mIsMediaViewer
qinmin 2017/02/02 17:29:42 is the if condition needed? IntentUtils.safeGetStr
gone 2017/02/02 18:38:49 It's a security check; we require the Intent to be
+ ? IntentUtils.safeGetStringExtra(intent, EXTRA_MEDIA_VIEWER_URL) : null;
mIsInfoPage = mIsTrustedIntent
&& IntentUtils.safeGetBooleanExtra(intent, EXTRA_IS_INFO_PAGE, false);
mDisableStar = IntentUtils.safeGetBooleanExtra(intent, EXTRA_DISABLE_STAR_BUTTON, false);
@@ -485,6 +492,13 @@ public class CustomTabIntentDataProvider {
}
/**
+ * @return See {@link #EXTRA_MEDIA_VIEWER_URL}.
+ */
+ String getMediaViewerUrl() {
+ return mMediaViewerUrl;
+ }
+
+ /**
* @return If the Custom Tab is an info page.
* See {@link #EXTRA_IS_INFO_PAGE}.
*/

Powered by Google App Engine
This is Rietveld 408576698