Commit eed49344 authored by Tina Wang's avatar Tina Wang Committed by Commit Bot

[ios] Expose accessibilityHint of TableViewInbuttonCell for generic usage

Previously the TableViewInfoButtonCell/Item is only used by managed settings UI, so the accessibility hint is set to "This settings is managed". Since the item and cell is refactored for generic usage, the accessibility hint should be exposed and be set accordingly.

Bug: 1124407
Change-Id: I292e6215c59fafb55618316ccdd176a3ae777c61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391504
Commit-Queue: Tina Wang <tinazwang@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807127}
parent 9f2b2a3a
......@@ -927,6 +927,9 @@ Because your account is managed by <ph name="HOSTED_DOMAIN">$1<ex>google.com</ex
<message name="IDS_IOS_ICON_SEARCH" desc="Accessibility label for the search icon [iOS only].">
Search
</message>
<message name="IDS_IOS_INFO_BUTTON_ACCESSIBILITY_HINT" desc="Action hint for the info button of the TableViewInfoButtonCell. This is spoken by VoiceOver. [iOS only]">
Double tap for more information
</message>
<message name="IDS_IOS_INFOBAR_BANNER_DISMISS_HINT" desc="Accessibility hint that indicates the user that can dismiss the Infobar Banner. [Length:Unlimited]">
Dismiss
</message>
......@@ -2300,7 +2303,7 @@ Your data was encrypted with your sync passphrase on <ph name="TIME">$2<ex>Sept
Double tap to toggle setting
</message>
<message name="IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT" desc="Action hint for any managed switch in settings. This is spoken by VoiceOver. [iOS only]">
This setting is managed
This setting is managed, double tap for more information
</message>
<message name="IDS_IOS_TOOLBAR_CLOSE_MENU" desc="The accessibility label for the toolbar close settings menu button [iOS only].">
Close Menu
......
6eee137d38ea101af02a996212e20b0a45cb6a5f
\ No newline at end of file
db847cb408ebf5437c718a7e8db2bdc8f5074afa
\ No newline at end of file
......@@ -218,6 +218,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
l10n_util::GetNSString(IDS_AUTOFILL_ENABLE_CREDIT_CARDS_TOGGLE_LABEL);
// The status could only be off when the pref is managed.
cardManagedItem.statusText = l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
cardManagedItem.accessibilityHint =
l10n_util::GetNSString(IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT);
cardManagedItem.accessibilityIdentifier = kAutofillCreditCardManagedViewId;
return cardManagedItem;
}
......
......@@ -173,6 +173,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
l10n_util::GetNSString(IDS_AUTOFILL_ENABLE_PROFILES_TOGGLE_LABEL);
// The status could only be off when the pref is managed.
managedAddressItem.statusText = l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
managedAddressItem.accessibilityHint =
l10n_util::GetNSString(IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT);
managedAddressItem.accessibilityIdentifier = @"addressItem_managed";
return managedAddressItem;
}
......
......@@ -160,6 +160,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
[_disablePopupsSetting value]
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
blockPopupsManagedItem.accessibilityHint =
l10n_util::GetNSString(IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT);
blockPopupsManagedItem.accessibilityIdentifier =
@"blockPopupsContentView_managed";
return blockPopupsManagedItem;
......
......@@ -713,6 +713,8 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error";
managedItem.detailText = GetNSString(detailStringID);
managedItem.statusText = status ? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
managedItem.accessibilityHint =
l10n_util::GetNSString(IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT);
return managedItem;
}
......
......@@ -147,6 +147,9 @@ typedef NS_ENUM(NSInteger, ItemType) {
[self.dataSource translateEnabled]
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
translateManagedItem.accessibilityHint = l10n_util::GetNSString(
IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT);
[model addItem:translateManagedItem
toSectionWithIdentifier:SectionIdentifierTranslate];
} else {
......
......@@ -537,6 +537,8 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
[_passwordManagerEnabled value]
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
managedSavePasswordItem.accessibilityHint =
l10n_util::GetNSString(IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT);
managedSavePasswordItem.accessibilityIdentifier =
@"savePasswordsItem_managed";
return managedSavePasswordItem;
......
......@@ -588,6 +588,8 @@ NSString* kDevViewSourceKey = @"DevViewSource";
managedDefaultSearchEngineItem.text =
l10n_util::GetNSString(IDS_IOS_SEARCH_ENGINE_SETTING_TITLE);
managedDefaultSearchEngineItem.iconImageName = kSettingsSearchEngineImageName;
managedDefaultSearchEngineItem.accessibilityHint =
l10n_util::GetNSString(IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT);
const base::DictionaryValue* dict = _browserState->GetPrefs()->GetDictionary(
DefaultSearchManager::kDefaultSearchProviderDataPrefName);
......
......@@ -313,8 +313,10 @@ const CGFloat kCellLabelsWidthProportion = 0.2f;
}
- (NSString*)accessibilityHint {
return l10n_util::GetNSString(
IDS_IOS_TOGGLE_SETTING_MANAGED_ACCESSIBILITY_HINT);
if (self.accessibilityHint.length) {
return self.accessibilityHint;
}
return l10n_util::GetNSString(IDS_IOS_INFO_BUTTON_ACCESSIBILITY_HINT);
}
- (NSString*)accessibilityLabel {
......
......@@ -27,6 +27,9 @@
// The status text string.
@property(nonatomic, copy) NSString* statusText;
// The accessibility hint text string.
@property(nonatomic, copy) NSString* accessibilityHint;
@end
#endif // IOS_CHROME_BROWSER_UI_TABLE_VIEW_CELLS_TABLE_VIEW_INFO_BUTTON_ITEM_H_
......@@ -33,6 +33,9 @@
[cell updatePaddingForDetailText:NO];
}
cell.statusTextLabel.text = self.statusText;
if (self.accessibilityHint) {
cell.accessibilityHint = self.accessibilityHint;
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// Update the icon image, if one is present.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment