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

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

Issue 1214553002: Make showing the page title in a custom tab a dev option (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made the added constants final Created 5 years, 6 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 067c3b0ae9ae36113a00bf0327497c8aa00e1b45..2dd0ec14d4c9a1d205cf0d60941ef4542523b3dc 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
@@ -59,6 +59,23 @@ public class CustomTabIntentDataProvider {
"android.support.CUSTOM_TABS:toolbar_color";
/**
+ * 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_CUSTOM_TABS_TITLE_VISIBILITY_STATE =
+ "android.support.CUSTOM_TABS:title_visibility";
+
+ /**
+ * Don't show any title. Shows only the domain.
+ */
+ public static final int CUSTOM_TAB_NO_TITLE = 0;
+
+ /**
+ * Shows the page title and the domain.
+ */
+ public static final int CUSTOM_TAB_SHOW_PAGE_TITLE = 1;
+
+ /**
* Bundle used for the action button parameters.
*/
public static final String EXTRA_CUSTOM_TABS_ACTION_BUTTON_BUNDLE =
@@ -108,6 +125,7 @@ public class CustomTabIntentDataProvider {
private static final String BUNDLE_EXIT_ANIMATION_RESOURCE = "android:animExitRes";
private final long mSessionId;
private final Intent mKeepAliveServiceIntent;
+ private final int mTitleVisibilityState;
private int mToolbarColor;
private Bitmap mIcon;
private PendingIntent mActionButtonPendingIntent;
@@ -156,6 +174,9 @@ public class CustomTabIntentDataProvider {
mAnimationBundle = IntentUtils.safeGetBundleExtra(
intent, EXTRA_CUSTOM_TABS_EXIT_ANIMATION_BUNDLE);
+
+ mTitleVisibilityState = IntentUtils.safeGetIntExtra(
+ intent, EXTRA_CUSTOM_TABS_TITLE_VISIBILITY_STATE, CUSTOM_TAB_NO_TITLE);
}
/**
@@ -198,6 +219,14 @@ public class CustomTabIntentDataProvider {
}
/**
+ * @return The title visibility state for the toolbar.
+ * Default is {@link CustomTabIntentDataProvider#CUSTOM_TAB_NO_TITLE}.
+ */
+ public int getTitleVisibilityState() {
+ return mTitleVisibilityState;
+ }
+
+ /**
* @return Whether the client app has provided sufficient info for the toolbar to show the
* action button.
*/

Powered by Google App Engine
This is Rietveld 408576698