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

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

Issue 1706353002: Added the selected text marker range to the dictionary for the selection change notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now works the first time you start the browser. Created 4 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 (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 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 9 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
10 10
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 BrowserAccessibility* start_object; 184 BrowserAccessibility* start_object;
185 BrowserAccessibility* end_object; 185 BrowserAccessibility* end_object;
186 int start_offset, end_offset; 186 int start_offset, end_offset;
187 if (!GetTextMarkerRange(marker_range, &start_object, &start_offset, 187 if (!GetTextMarkerRange(marker_range, &start_object, &start_offset,
188 &end_object, &end_offset)) { 188 &end_object, &end_offset)) {
189 return nil; 189 return nil;
190 } 190 }
191 DCHECK(start_object && end_object); 191 DCHECK(start_object && end_object);
192 DCHECK_GE(start_offset, 0); 192 DCHECK_GE(start_offset, 0);
193 DCHECK_GE(end_offset, 0); 193 DCHECK_GE(end_offset, 0);
194 LOG(ERROR) << "GetTextRange at " << start_offset << ' ' << end_offset << ' ' < < [[start_object->ToBrowserAccessibilityCocoa() role] UTF8String];
dmazzoni 2016/02/18 21:16:42 nit: remove this before landing
194 195
195 return base::SysUTF16ToNSString(BrowserAccessibilityManager::GetTextForRange( 196 return base::SysUTF16ToNSString(BrowserAccessibilityManager::GetTextForRange(
196 *start_object, start_offset, *end_object, end_offset)); 197 *start_object, start_offset, *end_object, end_offset));
197 } 198 }
198 199
199 // Returns an autoreleased copy of the AXNodeData's attribute. 200 // Returns an autoreleased copy of the AXNodeData's attribute.
200 NSString* NSStringForStringAttribute( 201 NSString* NSStringForStringAttribute(
201 BrowserAccessibility* browserAccessibility, 202 BrowserAccessibility* browserAccessibility,
202 StringAttribute attribute) { 203 StringAttribute attribute) {
203 return base::SysUTF8ToNSString( 204 return base::SysUTF8ToNSString(
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 if (!browserAccessibility_) 2412 if (!browserAccessibility_)
2412 return [super hash]; 2413 return [super hash];
2413 return browserAccessibility_->GetId(); 2414 return browserAccessibility_->GetId();
2414 } 2415 }
2415 2416
2416 - (BOOL)accessibilityShouldUseUniqueId { 2417 - (BOOL)accessibilityShouldUseUniqueId {
2417 return YES; 2418 return YES;
2418 } 2419 }
2419 2420
2420 @end 2421 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698