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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBar.java

Issue 926593006: [App banners] Update accessibility strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing some comments Created 5 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
« no previous file with comments | « no previous file | chrome/android/java/strings/android_chrome_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBar.java
index 5c57008960c38f305e6eb1ea6591130cfe3ff2e7..2f6222767245f7ffc4535eef5f161fce71ac33f8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBar.java
@@ -91,17 +91,25 @@ public class AppBannerInfoBar extends ConfirmInfoBar implements View.OnClickList
ratingView.setRating(mAppData.rating());
layout.getPrimaryButton().setButtonColor(getContext().getResources().getColor(
R.color.app_banner_install_button_bg));
- layout.setContentDescription(context.getString(
+ mTitleView.setContentDescription(context.getString(
R.string.app_banner_view_native_app_accessibility, mAppTitle,
mAppData.rating()));
mTitleView.removeView(webAppUrl);
+ updateButton();
} else {
// Web app.
webAppUrl.setText(mAppUrl);
- layout.setContentDescription(context.getString(
+ mTitleView.setContentDescription(context.getString(
R.string.app_banner_view_web_app_accessibility, mAppTitle,
mAppUrl));
mTitleView.removeView(ratingView);
+
+ }
+
+ // Hide uninteresting views from accessibility.
+ ratingView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
+ if (mIconView != null) {
+ mIconView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
}
// Set up clicking on the controls to bring up the app details.
@@ -127,13 +135,15 @@ public class AppBannerInfoBar extends ConfirmInfoBar implements View.OnClickList
}
private void updateButton() {
+ assert mAppData != null;
+
String text;
String accessibilityText = null;
boolean enabled = true;
if (mInstallState == INSTALL_STATE_NOT_INSTALLED) {
text = mAppData.installButtonText();
- accessibilityText =
- getContext().getString(R.string.app_banner_install_accessibility, text);
+ accessibilityText = getContext().getString(
+ R.string.app_banner_view_native_app_install_accessibility, text);
} else if (mInstallState == INSTALL_STATE_INSTALLING) {
text = getContext().getString(R.string.app_banner_installing);
enabled = false;
« no previous file with comments | « no previous file | chrome/android/java/strings/android_chrome_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698