Commit 41a3dcb5 authored by Tina Wang's avatar Tina Wang Committed by Commit Bot

[ios] Refactor the exposed accessibilityHint

Previously we check if the accessibilityHint is set in accessibilityHint method, which blocks the EG test when printing out the UI hierarchy by calling self.accessibilityHint infinitely. Refactor it to customizedAccessibilityHint and expose it in TableViewInfoButtonCell resolve this and make the logic clear. Because for now only settings UI are using TableViewInfoButtonCell and the accessibilityHint for it is customized.

This CL is followed by EG test for settings UI.

Change-Id: Ic56eb1fdd235bca9da06d076b31ee8c9537c805f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431725Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Tina Wang <tinazwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810804}
parent 066819f0
......@@ -34,6 +34,9 @@
// UIButton displayed aligned to the trailing of the view.
@property(nonatomic, readonly, strong) UIButton* trailingButton;
// The customized accessibility hint text string.
@property(nonatomic, copy) NSString* customizedAccessibilityHint;
// Sets the icon |image| and tint |color| for it that should be displayed at the
// leading edge of the cell. If set to nil, the icon will be hidden and the
// remaining content will expand to fill the full width of the cell.
......
......@@ -313,8 +313,8 @@ const CGFloat kCellLabelsWidthProportion = 0.2f;
}
- (NSString*)accessibilityHint {
if (self.accessibilityHint.length) {
return self.accessibilityHint;
if (self.customizedAccessibilityHint.length) {
return self.customizedAccessibilityHint;
}
return l10n_util::GetNSString(IDS_IOS_INFO_BUTTON_ACCESSIBILITY_HINT);
}
......
......@@ -34,7 +34,7 @@
}
cell.statusTextLabel.text = self.statusText;
if (self.accessibilityHint) {
cell.accessibilityHint = self.accessibilityHint;
cell.customizedAccessibilityHint = self.accessibilityHint;
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
......
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