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

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

Issue 1716683002: [Custom Tabs] Allow clients to display RemoteViews on the bottom bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make findbug happy Created 4 years, 10 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 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()}.
*/

Powered by Google App Engine
This is Rietveld 408576698