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

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

Issue 1263573011: Let client specify content description for custom action button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 4 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 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.
*/

Powered by Google App Engine
This is Rietveld 408576698