Skip to content

Commit

Permalink
[ios] Updates InfobarBanner A11y actions for banners with no modal.
Browse files Browse the repository at this point in the history
- Stops Adding the "Show Modal" A11y custom action for ConfirmInfobars
banners.

Bug: 1021597
Change-Id: I91ca187fbb7f70730af3cbfaf3c293140c6d06db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900138
Reviewed-by: Chris Lu <thegreenfrog@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713058}
  • Loading branch information
sczs authored and Commit Bot committed Nov 6, 2019
1 parent 85c1bdf commit c378a4e
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,20 @@ - (NSArray*)accessibilityActions {
target:self
selector:@selector(dismiss)];

UIAccessibilityCustomAction* modalAction =
[[UIAccessibilityCustomAction alloc]
initWithName:l10n_util::GetNSString(
IDS_IOS_INFOBAR_BANNER_OPTIONS_HINT)
target:self
selector:@selector(triggerInfobarModal)];
NSMutableArray* accessibilityActions =
[@[ acceptAction, dismissAction ] mutableCopy];

if (self.presentsModal) {
UIAccessibilityCustomAction* modalAction =
[[UIAccessibilityCustomAction alloc]
initWithName:l10n_util::GetNSString(
IDS_IOS_INFOBAR_BANNER_OPTIONS_HINT)
target:self
selector:@selector(triggerInfobarModal)];
[accessibilityActions addObject:modalAction];
}

return @[ acceptAction, dismissAction, modalAction ];
return accessibilityActions;
}

// A11y Custom actions selectors need to return a BOOL.
Expand Down

0 comments on commit c378a4e

Please sign in to comment.