| 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 ee45b7c7ce83f4690dd5085edcfc37d3e033480e..a51cf0ea1eca8e2a59a5bf32e74f3de554cd341b 100644
|
| --- a/customtabs/src/android/support/customtabs/CustomTabsSession.java
|
| +++ b/customtabs/src/android/support/customtabs/CustomTabsSession.java
|
| @@ -17,10 +17,12 @@
|
| package android.support.customtabs;
|
|
|
| import android.content.ComponentName;
|
| +import android.graphics.Bitmap;
|
| import android.net.Uri;
|
| import android.os.Bundle;
|
| import android.os.IBinder;
|
| import android.os.RemoteException;
|
| +import android.support.annotation.NonNull;
|
|
|
| import java.util.List;
|
|
|
| @@ -65,6 +67,27 @@ 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.
|
| + * @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) {
|
| + Bundle bundle = new Bundle();
|
| + bundle.putParcelable(CustomTabsIntent.KEY_ICON, icon);
|
| + bundle.putString(CustomTabsIntent.KEY_DESCRIPTION, description);
|
| +
|
| + Bundle metaBundle = new Bundle();
|
| + metaBundle.putBundle(CustomTabsIntent.EXTRA_ACTION_BUTTON_BUNDLE, bundle);
|
| + try {
|
| + return mService.updateVisuals(mCallback, metaBundle);
|
| + } catch (RemoteException e) {
|
| + return false;
|
| + }
|
| + }
|
| +
|
| /* package */ IBinder getBinder() {
|
| return mCallback.asBinder();
|
| }
|
| @@ -72,4 +95,4 @@ public final class CustomTabsSession {
|
| /* package */ ComponentName getComponentName() {
|
| return mComponentName;
|
| }
|
| -}
|
| +}
|
|
|