Chromium Code Reviews| 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 53c437df57281584a30631560379796a7458bca8..712da0846a2641f033c538c2885dfbfcc37e7265 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 |
| @@ -72,6 +72,13 @@ public class CustomTabIntentDataProvider { |
| public static final String EXTRA_TINT_ACTION_BUTTON = |
| "android.support.customtabs.extra.TINT_ACTION_BUTTON"; |
| + /** |
| + * Key that specifies the content description for the custom action button. |
| + * @TODO(ianwen): remove this key once it is added to CustomTabsIntent. |
| + */ |
| + public static final String KEY_DESCRIPTION = |
| + "android.support.customtabs.customaction.DESCRIPTION"; |
| + |
| private static final String BUNDLE_PACKAGE_NAME = "android:packageName"; |
| private static final String BUNDLE_ENTER_ANIMATION_RESOURCE = "android:animEnterRes"; |
| private static final String BUNDLE_EXIT_ANIMATION_RESOURCE = "android:animExitRes"; |
| @@ -80,6 +87,7 @@ public class CustomTabIntentDataProvider { |
| private final int mTitleVisibilityState; |
| private int mToolbarColor; |
| private Drawable mCustomButtonIcon; |
| + private String mCustomButtonDescription; |
| private Drawable mCloseButtonIcon; |
| private PendingIntent mActionButtonPendingIntent; |
| private List<Pair<String, PendingIntent>> mMenuEntries = new ArrayList<>(); |
| @@ -116,6 +124,12 @@ public class CustomTabIntentDataProvider { |
| } else { |
| mCustomButtonIcon = new BitmapDrawable(context.getResources(), bitmap); |
| } |
| + mCustomButtonDescription = IntentUtils.safeGetString(actionButtonBundle, |
| + KEY_DESCRIPTION); |
| + if (mCustomButtonIcon == null) { |
|
Yusuf
2015/08/05 18:43:04
I think the idea is this becomes a must. Anybody w
|
| + mCustomButtonDescription = context |
| + .getString(R.string.accessibility_toolbar_btn_custom); |
| + } |
| } |
| } |
| @@ -221,6 +235,13 @@ public class CustomTabIntentDataProvider { |
| } |
| /** |
| + * @return The content description for the custom action button. |
| + */ |
| + public String getActionButtonDescription() { |
| + return mCustomButtonDescription; |
| + } |
| + |
| + /** |
| * @return The {@link PendingIntent} that will be sent when the user clicks the action button. |
| * For testing only. |
| */ |