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 d0ad74c5be4246fe36721975fd71bf1211f840c2..3b360c74a100d6fe998400aa4602fcb88c6005c0 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 |
@@ -20,6 +20,7 @@ import android.os.IBinder; |
import android.support.customtabs.CustomTabsIntent; |
import android.text.TextUtils; |
import android.util.Pair; |
+import android.widget.RemoteViews; |
import org.chromium.base.ApiCompatibilityUtils; |
import org.chromium.base.Log; |
@@ -89,6 +90,7 @@ public class CustomTabIntentDataProvider { |
private boolean mShowShareItem; |
private CustomButtonParams mToolbarButton; |
private List<CustomButtonParams> mBottombarButtons = new ArrayList<>(2); |
+ private RemoteViews mRemoteViews; |
// OnFinished listener for PendingIntents. Used for testing only. |
private PendingIntent.OnFinished mOnFinished; |
@@ -149,6 +151,8 @@ public class CustomTabIntentDataProvider { |
CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE, CustomTabsIntent.NO_TITLE); |
mShowShareItem = IntentUtils.safeGetBooleanExtra(intent, |
CustomTabsIntent.EXTRA_DEFAULT_SHARE_MENU_ITEM, false); |
+ mRemoteViews = IntentUtils.safeGetParcelableExtra(intent, |
+ CustomTabsIntent.EXTRA_SECONDARY_TOOLBAR_REMOTEVIEWS); |
} |
/** |
@@ -278,7 +282,7 @@ public class CustomTabIntentDataProvider { |
* @return Whether the bottom bar should be shown. |
*/ |
public boolean shouldShowBottomBar() { |
- return !mBottombarButtons.isEmpty(); |
+ return !mBottombarButtons.isEmpty() || mRemoteViews != null; |
} |
/** |
@@ -289,6 +293,14 @@ public class CustomTabIntentDataProvider { |
} |
/** |
+ * @return The {@link RemoteViews} to show on the bottom bar, or null if the extra is not |
+ * specified. |
+ */ |
+ public RemoteViews getBottomBarRemoteViews() { |
+ return mRemoteViews; |
+ } |
+ |
+ /** |
* Gets params for all custom buttons, which is the combination of |
* {@link #getCustomButtonsOnBottombar()} and {@link #getCustomButtonOnToolbar()}. |
*/ |