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

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

Issue 1768753003: Implemented the reporting of text style and language information on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to using HashTable from base and GetInheritedStringAttribute instead of specialized methods… Created 4 years, 9 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 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 } else if ([role isEqualToString:NSAccessibilityProgressIndicatorRole] || 1499 } else if ([role isEqualToString:NSAccessibilityProgressIndicatorRole] ||
1500 [role isEqualToString:NSAccessibilitySliderRole] || 1500 [role isEqualToString:NSAccessibilitySliderRole] ||
1501 [role isEqualToString:NSAccessibilityIncrementorRole] || 1501 [role isEqualToString:NSAccessibilityIncrementorRole] ||
1502 [role isEqualToString:NSAccessibilityScrollBarRole]) { 1502 [role isEqualToString:NSAccessibilityScrollBarRole]) {
1503 float floatValue; 1503 float floatValue;
1504 if (browserAccessibility_->GetFloatAttribute( 1504 if (browserAccessibility_->GetFloatAttribute(
1505 ui::AX_ATTR_VALUE_FOR_RANGE, &floatValue)) { 1505 ui::AX_ATTR_VALUE_FOR_RANGE, &floatValue)) {
1506 return [NSNumber numberWithFloat:floatValue]; 1506 return [NSNumber numberWithFloat:floatValue];
1507 } 1507 }
1508 } else if ([role isEqualToString:NSAccessibilityColorWellRole]) { 1508 } else if ([role isEqualToString:NSAccessibilityColorWellRole]) {
1509 int color = browserAccessibility_->GetIntAttribute( 1509 unsigned int color = static_cast<unsigned int>(
1510 ui::AX_ATTR_COLOR_VALUE); 1510 browserAccessibility_->GetIntAttribute(ui::AX_ATTR_COLOR_VALUE));
1511 int red = (color >> 16) & 0xFF; 1511 unsigned int red, green, blue, alpha;
1512 int green = (color >> 8) & 0xFF; 1512 BrowserAccessibility::RGBAToColorValues(color, &red, &green, &blue, &alpha);
1513 int blue = color & 0xFF;
1514 // This string matches the one returned by a native Mac color well. 1513 // This string matches the one returned by a native Mac color well.
1515 return [NSString stringWithFormat:@"rgb %7.5f %7.5f %7.5f 1", 1514 return [NSString stringWithFormat:@"rgb %7.5f %7.5f %7.5f 1",
1516 red / 255., green / 255., blue / 255.]; 1515 red / 255., green / 255., blue / 255.];
1517 } 1516 }
1518 1517
1519 return base::SysUTF16ToNSString(browserAccessibility_->GetValue()); 1518 return base::SysUTF16ToNSString(browserAccessibility_->GetValue());
1520 } 1519 }
1521 1520
1522 - (NSString*)valueDescription { 1521 - (NSString*)valueDescription {
1523 if (browserAccessibility_) 1522 if (browserAccessibility_)
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
2326 if (!browserAccessibility_) 2325 if (!browserAccessibility_)
2327 return [super hash]; 2326 return [super hash];
2328 return browserAccessibility_->GetId(); 2327 return browserAccessibility_->GetId();
2329 } 2328 }
2330 2329
2331 - (BOOL)accessibilityShouldUseUniqueId { 2330 - (BOOL)accessibilityShouldUseUniqueId {
2332 return YES; 2331 return YES;
2333 } 2332 }
2334 2333
2335 @end 2334 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698