Chromium Code Reviews| Index: ui/views/cocoa/bridged_content_view.mm |
| diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm |
| index 80243f8a5f7535b5575269562de5e452fc64613f..c267f59166f15174149828002d63e30d627e9018 100644 |
| --- a/ui/views/cocoa/bridged_content_view.mm |
| +++ b/ui/views/cocoa/bridged_content_view.mm |
| @@ -25,6 +25,8 @@ |
| #include "ui/gfx/path.h" |
| #import "ui/gfx/path_mac.h" |
| #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| +#import "ui/accessibility/platform/ax_platform_node_mac.h" |
|
tapted
2016/09/26 05:19:18
nit: was this needed in the end?
Patti Lor
2016/09/28 00:29:14
Nope, have deleted it now - thanks.
|
| +#include "ui/views/accessibility/native_view_accessibility.h" |
| #import "ui/views/cocoa/bridged_native_widget.h" |
| #import "ui/views/cocoa/drag_drop_client_mac.h" |
| #include "ui/views/controls/menu/menu_config.h" |
| @@ -1363,4 +1365,17 @@ ui::KeyEvent GetCharacterEventFromNSEvent(NSEvent* event) { |
| return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| } |
| +- (id)accessibilityFocusedUIElement { |
| + NSWindow* keyWindow = [NSApp keyWindow]; |
| + // There won't be a keyWindow if there are no windows/views receiving keyboard |
| + // events, which means nothing from this NSApp has focus. |
| + if (!keyWindow) |
| + return nil; |
| + |
| + views::Widget* widget = views::Widget::GetWidgetForNativeWindow(keyWindow); |
| + if (!widget) |
| + return nil; |
|
tapted
2016/09/26 05:19:17
accessibilityFocusedUIElement says the receiver ca
Patti Lor
2016/09/28 00:29:14
Done.
|
| + return widget->GetRootView()->GetNativeViewAccessibility()->GetFocus(); |
| +} |
| + |
| @end |