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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

Issue 5097001: Support AXContents attribute on the RenderWidgetHostViewCocoa.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <QuartzCore/QuartzCore.h> 5 #include <QuartzCore/QuartzCore.h>
6 6
7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
8 8
9 #include "app/app_switches.h" 9 #include "app/app_switches.h"
10 #include "app/surface/io_surface_support_mac.h" 10 #include "app/surface/io_surface_support_mac.h"
(...skipping 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 } 1780 }
1781 1781
1782 - (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute { 1782 - (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute {
1783 NSArray* fullArray = [self accessibilityAttributeValue:attribute]; 1783 NSArray* fullArray = [self accessibilityAttributeValue:attribute];
1784 return [fullArray count]; 1784 return [fullArray count];
1785 } 1785 }
1786 1786
1787 - (id)accessibilityAttributeValue:(NSString *)attribute { 1787 - (id)accessibilityAttributeValue:(NSString *)attribute {
1788 BrowserAccessibilityManager* manager = 1788 BrowserAccessibilityManager* manager =
1789 renderWidgetHostView_->browser_accessibility_manager_.get(); 1789 renderWidgetHostView_->browser_accessibility_manager_.get();
1790 if ([attribute isEqualToString:NSAccessibilityChildrenAttribute] && 1790 if (([attribute isEqualToString:NSAccessibilityChildrenAttribute] ||
1791 [attribute isEqualToString:NSAccessibilityContentsAttribute]) &&
Chris Guillory 2010/11/16 22:37:11 Seems like it should be more clear that children a
1791 manager) { 1792 manager) {
1792 return [NSArray arrayWithObjects:manager-> 1793 return [NSArray arrayWithObjects:manager->
1793 GetRoot()->toBrowserAccessibilityCocoa(), nil]; 1794 GetRoot()->toBrowserAccessibilityCocoa(), nil];
1794 } else if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) { 1795 } else if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) {
1795 return NSAccessibilityScrollAreaRole; 1796 return NSAccessibilityScrollAreaRole;
1796 } 1797 }
1797 id ret = [super accessibilityAttributeValue:attribute]; 1798 id ret = [super accessibilityAttributeValue:attribute];
1798 return ret; 1799 return ret;
1799 } 1800 }
1800 1801
1802 - (NSArray*)accessibilityAttributeNames {
1803 NSMutableArray* ret = [[[NSMutableArray alloc] init] autorelease];
1804 [ret addObject:NSAccessibilityContentsAttribute];
1805 [ret addObjectsFromArray:[super accessibilityAttributeNames]];
Chris Guillory 2010/11/16 22:37:11 Nit: Should we check/dcheck that NSAccessibilityCo
1806 return ret;
1807 }
1808
1801 - (id)accessibilityHitTest:(NSPoint)point { 1809 - (id)accessibilityHitTest:(NSPoint)point {
1802 if (!renderWidgetHostView_->browser_accessibility_manager_.get()) 1810 if (!renderWidgetHostView_->browser_accessibility_manager_.get())
1803 return self; 1811 return self;
1804 NSPoint pointInWindow = [[self window] convertScreenToBase:point]; 1812 NSPoint pointInWindow = [[self window] convertScreenToBase:point];
1805 NSPoint localPoint = [self convertPoint:pointInWindow fromView:nil]; 1813 NSPoint localPoint = [self convertPoint:pointInWindow fromView:nil];
1806 localPoint.y = NSHeight([self bounds]) - localPoint.y; 1814 localPoint.y = NSHeight([self bounds]) - localPoint.y;
1807 BrowserAccessibilityCocoa* root = renderWidgetHostView_-> 1815 BrowserAccessibilityCocoa* root = renderWidgetHostView_->
1808 browser_accessibility_manager_-> 1816 browser_accessibility_manager_->
1809 GetRoot()->toBrowserAccessibilityCocoa(); 1817 GetRoot()->toBrowserAccessibilityCocoa();
1810 id obj = [root accessibilityHitTest:localPoint]; 1818 id obj = [root accessibilityHitTest:localPoint];
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
2562 if (!string) return NO; 2570 if (!string) return NO;
2563 2571
2564 // If the user is currently using an IME, confirm the IME input, 2572 // If the user is currently using an IME, confirm the IME input,
2565 // and then insert the text from the service, the same as TextEdit and Safari. 2573 // and then insert the text from the service, the same as TextEdit and Safari.
2566 [self confirmComposition]; 2574 [self confirmComposition];
2567 [self insertText:string]; 2575 [self insertText:string];
2568 return YES; 2576 return YES;
2569 } 2577 }
2570 2578
2571 @end 2579 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698