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

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

Issue 1303023002: Use third_party/custom_tabs_client as the src for customtabs library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 ee99a093ffefff274fccb4fd45b70436d90b5e1c..401a04ae14d86608a3c3ad5d2044fbba39079cec 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
@@ -15,8 +15,8 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
-import android.os.IBinder;
import android.support.customtabs.CustomTabsIntent;
+import android.support.customtabs.CustomTabsSessionToken;
import android.text.TextUtils;
import android.util.Pair;
@@ -41,41 +41,10 @@ public class CustomTabIntentDataProvider {
*/
public static final String EXTRA_KEEP_ALIVE = "android.support.customtabs.extra.KEEP_ALIVE";
- /**
- * Extra bitmap that specifies the icon of the back button on the toolbar. If the client chooses
- * not to customize it, a default close button will be used.
- */
- public static final String EXTRA_CLOSE_BUTTON_ICON =
- "android.support.customtabs.extra.CLOSE_BUTTON_ICON";
-
- /**
- * Extra int that specifies state for showing the page title. Default is showing only the domain
- * and no information about the title.
- */
- public static final String EXTRA_TITLE_VISIBILITY_STATE =
- "android.support.customtabs.extra.TITLE_VISIBILITY";
-
- /**
- * Don't show any title. Shows only the domain.
- */
- public static final int NO_TITLE = 0;
-
- /**
- * Shows the page title and the domain.
- */
- public static final int SHOW_PAGE_TITLE = 1;
-
- /**
- * Extra boolean that specifies whether the custom action button should be tinted. Default is
- * false and the action button will not be tinted.
- */
- public static final String EXTRA_TINT_ACTION_BUTTON =
- "android.support.customtabs.extra.TINT_ACTION_BUTTON";
-
private static final String BUNDLE_PACKAGE_NAME = "android:packageName";
private static final String BUNDLE_ENTER_ANIMATION_RESOURCE = "android:animEnterRes";
private static final String BUNDLE_EXIT_ANIMATION_RESOURCE = "android:animExitRes";
- private final IBinder mSession;
+ private final CustomTabsSessionToken mSession;
private final Intent mKeepAliveServiceIntent;
private final int mTitleVisibilityState;
private int mToolbarColor;
@@ -95,7 +64,7 @@ public class CustomTabIntentDataProvider {
public CustomTabIntentDataProvider(Intent intent, Context context) {
if (intent == null) assert false;
- mSession = IntentUtils.safeGetBinderExtra(intent, CustomTabsIntent.EXTRA_SESSION);
+ mSession = CustomTabsSessionToken.getSessionTokenFromIntent(intent);
retrieveToolbarColor(intent, context);
mEnableUrlBarHiding = IntentUtils.safeGetBooleanExtra(
intent, CustomTabsIntent.EXTRA_ENABLE_URLBAR_HIDING, false);
@@ -113,7 +82,7 @@ public class CustomTabIntentDataProvider {
mCustomButtonPendingIntent = IntentUtils.safeGetParcelable(
actionButtonBundle, CustomTabsIntent.KEY_PENDING_INTENT);
boolean shouldTint = IntentUtils.safeGetBooleanExtra(intent,
- EXTRA_TINT_ACTION_BUTTON, false);
+ CustomTabsIntent.EXTRA_TINT_ACTION_BUTTON, false);
if (shouldTint) {
mCustomButtonIcon = TintedDrawable
.constructTintedDrawable(context.getResources(), bitmap);
@@ -125,7 +94,8 @@ public class CustomTabIntentDataProvider {
}
}
- Bitmap bitmap = IntentUtils.safeGetParcelableExtra(intent, EXTRA_CLOSE_BUTTON_ICON);
+ Bitmap bitmap = IntentUtils.safeGetParcelableExtra(intent,
+ CustomTabsIntent.EXTRA_CLOSE_BUTTON_ICON);
if (bitmap != null && !checkCloseButtonSize(context, bitmap)) {
bitmap.recycle();
bitmap = null;
@@ -153,7 +123,8 @@ public class CustomTabIntentDataProvider {
mAnimationBundle = IntentUtils.safeGetBundleExtra(
intent, CustomTabsIntent.EXTRA_EXIT_ANIMATION_BUNDLE);
mTitleVisibilityState =
- IntentUtils.safeGetIntExtra(intent, EXTRA_TITLE_VISIBILITY_STATE, NO_TITLE);
+ IntentUtils.safeGetIntExtra(intent,
+ CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE, CustomTabsIntent.NO_TITLE);
}
/**
@@ -175,7 +146,7 @@ public class CustomTabIntentDataProvider {
/**
* @return The session specified in the intent, or null.
*/
- public IBinder getSession() {
+ public CustomTabsSessionToken getSession() {
return mSession;
}
@@ -212,7 +183,7 @@ public class CustomTabIntentDataProvider {
/**
* @return The title visibility state for the toolbar.
- * Default is {@link CustomTabIntentDataProvider#NO_TITLE}.
+ * Default is {@link CustomTabsIntent#NO_TITLE}.
*/
public int getTitleVisibilityState() {
return mTitleVisibilityState;

Powered by Google App Engine
This is Rietveld 408576698