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

Unified Diff: customtabs/src/android/support/customtabs/CustomTabsSession.java

Issue 1568433003: Add APIs to CustomTabsIntent and CustomTabsSession for Bottombar (Closed) Base URL: https://github.com/GoogleChrome/custom-tabs-client.git@compile
Patch Set: Make setActionButton not override addActionButton Created 4 years, 11 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
« no previous file with comments | « customtabs/src/android/support/customtabs/CustomTabsIntent.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: customtabs/src/android/support/customtabs/CustomTabsSession.java
diff --git a/customtabs/src/android/support/customtabs/CustomTabsSession.java b/customtabs/src/android/support/customtabs/CustomTabsSession.java
index a51cf0ea1eca8e2a59a5bf32e74f3de554cd341b..09c796b2b583abb864b9995fec4a846956b8e848 100644
--- a/customtabs/src/android/support/customtabs/CustomTabsSession.java
+++ b/customtabs/src/android/support/customtabs/CustomTabsSession.java
@@ -68,14 +68,23 @@ public final class CustomTabsSession {
}
/**
- * Update the visuals for the button on a custom tab. Will only succeed if the given
- * session is the active one in browser.
+ * @see {@link #setActionButton(Bitmap, String)}
+ */
+ public boolean setActionButton(@NonNull Bitmap icon, @NonNull String description) {
+ return setActionButton(CustomTabsIntent.TOOLBAR_ACTION_BUTTON_ID, icon, description);
+ }
+
+ /**
+ * Updates the visuals for custom action buttons. Will only succeed if the given
+ * session is the active one in browser and the given id is valid.
+ * @param id The id for the button to update.
* @param icon The new icon of the action button.
* @param description Content description of the action button.
* @return Whether the update succeeded.
*/
- public boolean setActionButton(@NonNull Bitmap icon, @NonNull String description) {
+ public boolean setActionButton(int id, @NonNull Bitmap icon, @NonNull String description) {
Bundle bundle = new Bundle();
+ bundle.putInt(CustomTabsIntent.KEY_ID, id);
bundle.putParcelable(CustomTabsIntent.KEY_ICON, icon);
bundle.putString(CustomTabsIntent.KEY_DESCRIPTION, description);
« no previous file with comments | « customtabs/src/android/support/customtabs/CustomTabsIntent.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698