Chromium Code Reviews| 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}. |
| */ |