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

Side by Side Diff: ui/accessibility/platform/ax_platform_node_mac.mm

Issue 909143003: Re-land: Implement NativeViewAccessibilityWin using AXPlatformNodeWin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update GN build Created 5 years, 10 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
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/accessibility/platform/ax_platform_node_mac.h" 5 #import "ui/accessibility/platform/ax_platform_node_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #import "ui/accessibility/ax_node_data.h"
10 #import "ui/accessibility/platform/ax_platform_node_delegate.h" 11 #import "ui/accessibility/platform/ax_platform_node_delegate.h"
11 #import "ui/gfx/mac/coordinate_conversion.h" 12 #import "ui/gfx/mac/coordinate_conversion.h"
12 13
13 namespace { 14 namespace {
14 15
15 struct MapEntry { 16 struct MapEntry {
16 ui::AXRole value; 17 ui::AXRole value;
17 NSString* nativeValue; 18 NSString* nativeValue;
18 }; 19 };
19 20
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return NSAccessibilityUnignoredAncestor(node_->GetParent()); 230 return NSAccessibilityUnignoredAncestor(node_->GetParent());
230 } 231 }
231 232
232 - (NSValue*)AXPosition { 233 - (NSValue*)AXPosition {
233 return [NSValue valueWithPoint:self.boundsInScreen.origin]; 234 return [NSValue valueWithPoint:self.boundsInScreen.origin];
234 } 235 }
235 236
236 - (NSString*)AXRole { 237 - (NSString*)AXRole {
237 if (!node_) 238 if (!node_)
238 return nil; 239 return nil;
239 return [[self class] nativeRoleFromAXRole:node_->GetRole()]; 240 return [[self class] nativeRoleFromAXRole:node_->GetData().role];
240 } 241 }
241 242
242 - (NSValue*)AXSize { 243 - (NSValue*)AXSize {
243 return [NSValue valueWithSize:self.boundsInScreen.size]; 244 return [NSValue valueWithSize:self.boundsInScreen.size];
244 } 245 }
245 246
246 // NSAccessibility informal protocol implementation. 247 // NSAccessibility informal protocol implementation.
247 248
248 - (BOOL)accessibilityIsIgnored { 249 - (BOOL)accessibilityIsIgnored {
249 return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole]; 250 return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole];
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 296
296 AXPlatformNodeMac::AXPlatformNodeMac() { 297 AXPlatformNodeMac::AXPlatformNodeMac() {
297 } 298 }
298 299
299 AXPlatformNodeMac::~AXPlatformNodeMac() { 300 AXPlatformNodeMac::~AXPlatformNodeMac() {
300 } 301 }
301 302
302 void AXPlatformNodeMac::Destroy() { 303 void AXPlatformNodeMac::Destroy() {
303 if (native_node_) 304 if (native_node_)
304 [native_node_ detach]; 305 [native_node_ detach];
305 delegate_ = NULL; 306 delegate_ = nullptr;
306 delete this; 307 delete this;
307 } 308 }
308 309
309 gfx::NativeViewAccessible AXPlatformNodeMac::GetNativeViewAccessible() { 310 gfx::NativeViewAccessible AXPlatformNodeMac::GetNativeViewAccessible() {
310 if (!native_node_) 311 if (!native_node_)
311 native_node_.reset([[AXPlatformNodeCocoa alloc] initWithNode:this]); 312 native_node_.reset([[AXPlatformNodeCocoa alloc] initWithNode:this]);
312 return native_node_.get(); 313 return native_node_.get();
313 } 314 }
314 315
316 void AXPlatformNodeMac::NotifyAccessibilityEvent(ui::AXEvent event_type) {
317 // TODO(dmazzoni): implement this. http://crbug.com/396137
318 }
319
320 int AXPlatformNodeMac::GetIndexInParent() {
321 // TODO(dmazzoni): implement this. http://crbug.com/396137
322 return -1;
323 }
324
315 } // namespace ui 325 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_mac.h ('k') | ui/accessibility/platform/ax_platform_node_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698