OLD | NEW |
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 "content/browser/accessibility/accessibility_tree_formatter.h" | 5 #include "content/browser/accessibility/accessibility_tree_formatter.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } else if (value != nil) { | 154 } else if (value != nil) { |
155 dict->SetString( | 155 dict->SetString( |
156 SysNSStringToUTF8(requestedAttribute), | 156 SysNSStringToUTF8(requestedAttribute), |
157 SysNSStringToUTF16([NSString stringWithFormat:@"%@", value])); | 157 SysNSStringToUTF16([NSString stringWithFormat:@"%@", value])); |
158 } | 158 } |
159 } | 159 } |
160 dict->Set(kPositionDictAttr, PopulatePosition(node).release()); | 160 dict->Set(kPositionDictAttr, PopulatePosition(node).release()); |
161 dict->Set(kSizeDictAttr, PopulateSize(cocoa_node).release()); | 161 dict->Set(kSizeDictAttr, PopulateSize(cocoa_node).release()); |
162 } | 162 } |
163 | 163 |
164 string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& dict, | 164 base::string16 AccessibilityTreeFormatter::ToString( |
165 const string16& indent) { | 165 const base::DictionaryValue& dict, |
166 string16 line; | 166 const base::string16& indent) { |
| 167 base::string16 line; |
167 NSArray* defaultAttributes = | 168 NSArray* defaultAttributes = |
168 [NSArray arrayWithObjects:NSAccessibilityTitleAttribute, | 169 [NSArray arrayWithObjects:NSAccessibilityTitleAttribute, |
169 NSAccessibilityValueAttribute, | 170 NSAccessibilityValueAttribute, |
170 nil]; | 171 nil]; |
171 string s_value; | 172 string s_value; |
172 dict.GetString(SysNSStringToUTF8(NSAccessibilityRoleAttribute), &s_value); | 173 dict.GetString(SysNSStringToUTF8(NSAccessibilityRoleAttribute), &s_value); |
173 WriteAttribute(true, UTF8ToUTF16(s_value), &line); | 174 WriteAttribute(true, UTF8ToUTF16(s_value), &line); |
174 | 175 |
175 string subroleAttribute = SysNSStringToUTF8(NSAccessibilitySubroleAttribute); | 176 string subroleAttribute = SysNSStringToUTF8(NSAccessibilitySubroleAttribute); |
176 if (dict.GetString(subroleAttribute, &s_value)) { | 177 if (dict.GetString(subroleAttribute, &s_value)) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 const string AccessibilityTreeFormatter::GetAllowString() { | 242 const string AccessibilityTreeFormatter::GetAllowString() { |
242 return "@MAC-ALLOW:"; | 243 return "@MAC-ALLOW:"; |
243 } | 244 } |
244 | 245 |
245 // static | 246 // static |
246 const string AccessibilityTreeFormatter::GetDenyString() { | 247 const string AccessibilityTreeFormatter::GetDenyString() { |
247 return "@MAC-DENY:"; | 248 return "@MAC-DENY:"; |
248 } | 249 } |
249 | 250 |
250 } // namespace content | 251 } // namespace content |
OLD | NEW |