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 |