Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: ui/views/cocoa/bridged_content_view.mm

Issue 2119413004: a11y: Exclude children of nested keyboard accessible controls from a11y tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Before revert of cross-platform ignored a11y elements. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/accessibility/native_view_accessibility_unittest.cc ('k') | ui/views/view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import "base/mac/sdk_forward_declarations.h" 10 #import "base/mac/sdk_forward_declarations.h"
11 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
12 #include "skia/ext/skia_utils_mac.h" 12 #include "skia/ext/skia_utils_mac.h"
13 #import "ui/accessibility/platform/ax_platform_node_mac.h"
13 #include "ui/base/cocoa/cocoa_base_utils.h" 14 #include "ui/base/cocoa/cocoa_base_utils.h"
14 #include "ui/base/dragdrop/drag_drop_types.h" 15 #include "ui/base/dragdrop/drag_drop_types.h"
15 #include "ui/base/dragdrop/os_exchange_data_provider_mac.h" 16 #include "ui/base/dragdrop/os_exchange_data_provider_mac.h"
16 #include "ui/base/ime/input_method.h" 17 #include "ui/base/ime/input_method.h"
17 #include "ui/base/ime/text_edit_commands.h" 18 #include "ui/base/ime/text_edit_commands.h"
18 #include "ui/base/ime/text_input_client.h" 19 #include "ui/base/ime/text_input_client.h"
19 #include "ui/compositor/canvas_painter.h" 20 #include "ui/compositor/canvas_painter.h"
20 #import "ui/events/cocoa/cocoa_event_utils.h" 21 #import "ui/events/cocoa/cocoa_event_utils.h"
21 #include "ui/events/event_utils.h" 22 #include "ui/events/event_utils.h"
22 #include "ui/events/keycodes/dom/dom_code.h" 23 #include "ui/events/keycodes/dom/dom_code.h"
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 endedAtPoint:(NSPoint)screenPoint 1415 endedAtPoint:(NSPoint)screenPoint
1415 operation:(NSDragOperation)operation { 1416 operation:(NSDragOperation)operation {
1416 views::DragDropClientMac* client = [self dragDropClient]; 1417 views::DragDropClientMac* client = [self dragDropClient];
1417 if (client) 1418 if (client)
1418 client->EndDrag(); 1419 client->EndDrag();
1419 } 1420 }
1420 1421
1421 // NSAccessibility informal protocol implementation. 1422 // NSAccessibility informal protocol implementation.
1422 1423
1423 - (id)accessibilityAttributeValue:(NSString*)attribute { 1424 - (id)accessibilityAttributeValue:(NSString*)attribute {
1424 if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) { 1425 if ([attribute isEqualToString:NSAccessibilityChildrenAttribute])
1425 return @[ hostedView_->GetNativeViewAccessible() ]; 1426 return [((AXPlatformNodeCocoa*)hostedView_->GetNativeViewAccessible())
1426 } 1427 accessibilityAttributeValue:attribute];
1428 else if ([attribute isEqualToString:NSAccessibilityParentAttribute])
1429 // BridgedContentView is the top level for Views in a Widget.
1430 return self;
1431 else if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
1432 return NSAccessibilityWindowRole;
1427 1433
1428 return [super accessibilityAttributeValue:attribute]; 1434 return [super accessibilityAttributeValue:attribute];
1429 } 1435 }
1430 1436
1431 - (id)accessibilityHitTest:(NSPoint)point { 1437 - (id)accessibilityHitTest:(NSPoint)point {
1432 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; 1438 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point];
1433 } 1439 }
1434 1440
1435 - (id)accessibilityFocusedUIElement { 1441 - (id)accessibilityFocusedUIElement {
1436 if (!hostedView_) 1442 if (!hostedView_)
1437 return nil; 1443 return nil;
1438 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; 1444 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement];
1439 } 1445 }
1440 1446
1441 @end 1447 @end
OLDNEW
« no previous file with comments | « ui/views/accessibility/native_view_accessibility_unittest.cc ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698