Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ui/views/cocoa/bridged_content_view.h" | 5 #import "ui/views/cocoa/bridged_content_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/mac_util.h" | 8 #import "base/mac/mac_util.h" |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| 11 #include "skia/ext/skia_utils_mac.h" | 11 #include "skia/ext/skia_utils_mac.h" |
| 12 #include "ui/base/cocoa/cocoa_base_utils.h" | 12 #include "ui/base/cocoa/cocoa_base_utils.h" |
| 13 #include "ui/base/dragdrop/drag_drop_types.h" | 13 #include "ui/base/dragdrop/drag_drop_types.h" |
| 14 #include "ui/base/dragdrop/os_exchange_data_provider_mac.h" | 14 #include "ui/base/dragdrop/os_exchange_data_provider_mac.h" |
| 15 #include "ui/base/ime/input_method.h" | 15 #include "ui/base/ime/input_method.h" |
| 16 #include "ui/base/ime/text_edit_commands.h" | 16 #include "ui/base/ime/text_edit_commands.h" |
| 17 #include "ui/base/ime/text_input_client.h" | 17 #include "ui/base/ime/text_input_client.h" |
| 18 #include "ui/compositor/canvas_painter.h" | 18 #include "ui/compositor/canvas_painter.h" |
| 19 #import "ui/events/cocoa/cocoa_event_utils.h" | 19 #import "ui/events/cocoa/cocoa_event_utils.h" |
| 20 #include "ui/events/keycodes/dom/dom_code.h" | 20 #include "ui/events/keycodes/dom/dom_code.h" |
| 21 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" | 21 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" |
| 22 #include "ui/gfx/canvas_paint_mac.h" | 22 #include "ui/gfx/canvas_paint_mac.h" |
| 23 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
| 24 #import "ui/gfx/mac/coordinate_conversion.h" | 24 #import "ui/gfx/mac/coordinate_conversion.h" |
| 25 #include "ui/gfx/path.h" | 25 #include "ui/gfx/path.h" |
| 26 #import "ui/gfx/path_mac.h" | 26 #import "ui/gfx/path_mac.h" |
| 27 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 27 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| 28 #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.
| |
| 29 #include "ui/views/accessibility/native_view_accessibility.h" | |
| 28 #import "ui/views/cocoa/bridged_native_widget.h" | 30 #import "ui/views/cocoa/bridged_native_widget.h" |
| 29 #import "ui/views/cocoa/drag_drop_client_mac.h" | 31 #import "ui/views/cocoa/drag_drop_client_mac.h" |
| 30 #include "ui/views/controls/menu/menu_config.h" | 32 #include "ui/views/controls/menu/menu_config.h" |
| 31 #include "ui/views/controls/menu/menu_controller.h" | 33 #include "ui/views/controls/menu/menu_controller.h" |
| 32 #include "ui/views/view.h" | 34 #include "ui/views/view.h" |
| 33 #include "ui/views/widget/native_widget_mac.h" | 35 #include "ui/views/widget/native_widget_mac.h" |
| 34 #include "ui/views/widget/widget.h" | 36 #include "ui/views/widget/widget.h" |
| 35 | 37 |
| 36 using views::MenuController; | 38 using views::MenuController; |
| 37 | 39 |
| (...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1356 return @[ hostedView_->GetNativeViewAccessible() ]; | 1358 return @[ hostedView_->GetNativeViewAccessible() ]; |
| 1357 } | 1359 } |
| 1358 | 1360 |
| 1359 return [super accessibilityAttributeValue:attribute]; | 1361 return [super accessibilityAttributeValue:attribute]; |
| 1360 } | 1362 } |
| 1361 | 1363 |
| 1362 - (id)accessibilityHitTest:(NSPoint)point { | 1364 - (id)accessibilityHitTest:(NSPoint)point { |
| 1363 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1365 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1364 } | 1366 } |
| 1365 | 1367 |
| 1368 - (id)accessibilityFocusedUIElement { | |
| 1369 NSWindow* keyWindow = [NSApp keyWindow]; | |
| 1370 // There won't be a keyWindow if there are no windows/views receiving keyboard | |
| 1371 // events, which means nothing from this NSApp has focus. | |
| 1372 if (!keyWindow) | |
| 1373 return nil; | |
| 1374 | |
| 1375 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(keyWindow); | |
| 1376 if (!widget) | |
| 1377 return nil; | |
|
tapted
2016/09/26 05:19:17
accessibilityFocusedUIElement says the receiver ca
Patti Lor
2016/09/28 00:29:14
Done.
| |
| 1378 return widget->GetRootView()->GetNativeViewAccessibility()->GetFocus(); | |
| 1379 } | |
| 1380 | |
| 1366 @end | 1381 @end |
| OLD | NEW |