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

Side by Side Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 1365433002: Add setSelection function to automation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nobrailleautostartintests
Patch Set: rebase Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <execinfo.h> 5 #include <execinfo.h>
6 6
7 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 7 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 1933
1934 if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { 1934 if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
1935 BrowserAccessibilityManager* manager = browserAccessibility_->manager(); 1935 BrowserAccessibilityManager* manager = browserAccessibility_->manager();
1936 NSNumber* focusedNumber = value; 1936 NSNumber* focusedNumber = value;
1937 BOOL focused = [focusedNumber intValue]; 1937 BOOL focused = [focusedNumber intValue];
1938 if (focused) 1938 if (focused)
1939 manager->SetFocus(browserAccessibility_, true); 1939 manager->SetFocus(browserAccessibility_, true);
1940 } 1940 }
1941 if ([attribute isEqualToString:NSAccessibilitySelectedTextRangeAttribute]) { 1941 if ([attribute isEqualToString:NSAccessibilitySelectedTextRangeAttribute]) {
1942 NSRange range = [(NSValue*)value rangeValue]; 1942 NSRange range = [(NSValue*)value rangeValue];
1943 [self delegate]->AccessibilitySetTextSelection( 1943 [self delegate]->AccessibilitySetSelection(
1944 browserAccessibility_->GetId(), 1944 browserAccessibility_->GetId(),
1945 range.location, range.location + range.length); 1945 range.location,
1946 browserAccessibility_->GetId(),
1947 range.location + range.length);
1946 } 1948 }
1947 } 1949 }
1948 1950
1949 // Returns the deepest accessibility child that should not be ignored. 1951 // Returns the deepest accessibility child that should not be ignored.
1950 // It is assumed that the hit test has been narrowed down to this object 1952 // It is assumed that the hit test has been narrowed down to this object
1951 // or one of its children, so this will never return nil unless this 1953 // or one of its children, so this will never return nil unless this
1952 // object is invalid. 1954 // object is invalid.
1953 - (id)accessibilityHitTest:(NSPoint)point { 1955 - (id)accessibilityHitTest:(NSPoint)point {
1954 if (!browserAccessibility_) 1956 if (!browserAccessibility_)
1955 return nil; 1957 return nil;
(...skipping 30 matching lines...) Expand all
1986 if (!browserAccessibility_) 1988 if (!browserAccessibility_)
1987 return [super hash]; 1989 return [super hash];
1988 return browserAccessibility_->GetId(); 1990 return browserAccessibility_->GetId();
1989 } 1991 }
1990 1992
1991 - (BOOL)accessibilityShouldUseUniqueId { 1993 - (BOOL)accessibilityShouldUseUniqueId {
1992 return YES; 1994 return YES;
1993 } 1995 }
1994 1996
1995 @end 1997 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698