diff options
author | juncai <juncai@chromium.org> | 2016-03-25 14:38:11 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-25 21:45:26 +0000 |
commit | 9f0ead0fd04825415795733a60d1cf587fd12b2a (patch) | |
tree | 2d112227ab417a01728f4a479d8672cfe9bf3154 | |
parent | d1fd45b7740d761757feebf912d250515cc0baf6 (diff) | |
download | chromium_src-9f0ead0fd04825415795733a60d1cf587fd12b2a.zip chromium_src-9f0ead0fd04825415795733a60d1cf587fd12b2a.tar.gz chromium_src-9f0ead0fd04825415795733a60d1cf587fd12b2a.tar.bz2 |
Add keyboard accessibility to ConstrainedWindowButton
This patch added keyboard accessibility to ConstrainedWindowButton.
ConstrainedWindowButton is used by WebUSB chooser bubble,
Geolocation permission bubble, etc. Previously, when trying to only
interact with these bubbles with the keyboard, there are no focus
styles. User should be able to press tab to navigate to buttons, and
see a visible focus state. It will allow the user to only use keyboard
to control the bubble, which improves the accessibility of the UI
that uses it.
BUG=596671
Review URL: https://codereview.chromium.org/1829393002
Cr-Commit-Position: refs/heads/master@{#383368}
-rw-r--r-- | chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm | 4 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm index 9ea5fe9..acb4bee 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm @@ -245,6 +245,10 @@ void DrawBorder(const NSRect& frame, [path stroke]; } +- (BOOL)canBecomeKeyView { + return YES; +} + @end @implementation ConstrainedWindowButtonCell diff --git a/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm index 2c472ec..3e8f420 100644 --- a/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm +++ b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm @@ -330,7 +330,7 @@ scoped_ptr<BubbleUi> ChooserBubbleController::BuildBubbleUi() { [self setAnchorPoint:[self getExpectedAnchorPoint]]; [self showWindow:nil]; [[self window] makeFirstResponder:nil]; - [[self window] setInitialFirstResponder:connectButton_.get()]; + [[self window] setInitialFirstResponder:tableView_.get()]; } } |