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

Unified Diff: ios/chrome/browser/ui/settings/cells/native_app_item.mm

Issue 2607763002: Adds button accessibility traits to the nativeAppItem cell. (Closed)
Patch Set: Remove accesibility hint Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/settings/cells/native_app_item.mm
diff --git a/ios/chrome/browser/ui/settings/cells/native_app_item.mm b/ios/chrome/browser/ui/settings/cells/native_app_item.mm
index f52856ab5504c94bb9071bef084b8b4f18854eec..7466b1b532e20d74a1f7fefc39577fa8e1984903 100644
--- a/ios/chrome/browser/ui/settings/cells/native_app_item.mm
+++ b/ios/chrome/browser/ui/settings/cells/native_app_item.mm
@@ -73,6 +73,7 @@ UIImage* PlaceholderIcon() {
self = [super initWithFrame:frame];
if (self) {
UIView* contentView = self.contentView;
+ self.isAccessibilityElement = YES;
_iconImageView = [[UIImageView alloc] init];
_iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
@@ -101,8 +102,6 @@ UIImage* PlaceholderIcon() {
setTitle:l10n_util::GetNSString(IDS_IOS_GOOGLE_APPS_INSTALL_BUTTON)
forState:UIControlStateNormal];
[_installButton setTitle:@"" forState:UIControlStateDisabled];
- _installButton.accessibilityHint = l10n_util::GetNSString(
- IDS_IOS_GOOGLE_APPS_INSTALL_BUTTON_ACCESSIBILITY_HINT);
// Set up the constraints.
[NSLayoutConstraint activateConstraints:@[
@@ -171,21 +170,24 @@ UIImage* PlaceholderIcon() {
return [self.accessoryView accessibilityHint];
}
-- (UIAccessibilityTraits)accessibilityTraits {
- // Remove the "button" accessibility trait from the switch. This matches
- // native switch content views such as Settings > Airplane Mode.
- return
- [super accessibilityTraits] |
- ([self.switchControl accessibilityTraits] & ~UIAccessibilityTraitButton);
-}
-
- (NSString*)accessibilityValue {
if (self.accessoryView == self.switchControl) {
- return (self.switchControl.on)
- ? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
- : l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
+ if (self.switchControl.on) {
+ return [NSString
+ stringWithFormat:@"%@, %@", self.nameLabel.text,
+ l10n_util::GetNSString(IDS_IOS_SETTING_ON)];
+ } else {
+ return [NSString
+ stringWithFormat:@"%@, %@", self.nameLabel.text,
+ l10n_util::GetNSString(IDS_IOS_SETTING_OFF)];
+ }
}
- return [self.accessoryView accessibilityValue];
+
+ return
+ [NSString stringWithFormat:
+ @"%@, %@", self.nameLabel.text,
+ l10n_util::GetNSString(
+ IDS_IOS_GOOGLE_APPS_INSTALL_BUTTON_ACCESSIBILITY_HINT)];
lpromero 2017/01/05 23:00:58 The hint reads: "Double tap to install", so I real
sczs 2017/01/05 23:17:24 You're right, the "INSTALL" text wasn't being read
}
@end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698