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

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: Add Accesibility hint and install text value. 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..aad554b71ecde105094530ef52c9eb15b8710826 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;
@@ -171,21 +172,22 @@ 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)];
}
@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