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 #include <oleacc.h> | 7 #include <oleacc.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 base::string16 AccessibilityTreeFormatter::ToString( | 201 base::string16 AccessibilityTreeFormatter::ToString( |
202 const base::DictionaryValue& dict, | 202 const base::DictionaryValue& dict, |
203 const base::string16& indent) { | 203 const base::string16& indent) { |
204 base::string16 line; | 204 base::string16 line; |
205 | 205 |
206 base::string16 role_value; | 206 base::string16 role_value; |
207 dict.GetString("role", &role_value); | 207 dict.GetString("role", &role_value); |
208 WriteAttribute(true, base::UTF16ToUTF8(role_value), &line); | 208 WriteAttribute(true, base::UTF16ToUTF8(role_value), &line); |
209 | 209 |
210 base::string16 name_value; | |
211 dict.GetString("name", &name_value); | |
212 WriteAttribute(true, base::StringPrintf(L"name='%ls'", name_value.c_str()), | |
213 &line); | |
214 | |
215 for (int i = 0; i < arraysize(ALL_ATTRIBUTES); i++) { | 210 for (int i = 0; i < arraysize(ALL_ATTRIBUTES); i++) { |
216 const char* attribute_name = ALL_ATTRIBUTES[i]; | 211 const char* attribute_name = ALL_ATTRIBUTES[i]; |
217 const base::Value* value; | 212 const base::Value* value; |
218 if (!dict.Get(attribute_name, &value)) | 213 if (!dict.Get(attribute_name, &value)) |
219 continue; | 214 continue; |
220 | 215 |
221 switch (value->GetType()) { | 216 switch (value->GetType()) { |
222 case base::Value::TYPE_STRING: { | 217 case base::Value::TYPE_STRING: { |
223 base::string16 string_value; | 218 base::string16 string_value; |
224 value->GetAsString(&string_value); | 219 value->GetAsString(&string_value); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 const std::string AccessibilityTreeFormatter::GetAllowString() { | 307 const std::string AccessibilityTreeFormatter::GetAllowString() { |
313 return "@WIN-ALLOW:"; | 308 return "@WIN-ALLOW:"; |
314 } | 309 } |
315 | 310 |
316 // static | 311 // static |
317 const std::string AccessibilityTreeFormatter::GetDenyString() { | 312 const std::string AccessibilityTreeFormatter::GetDenyString() { |
318 return "@WIN-DENY:"; | 313 return "@WIN-DENY:"; |
319 } | 314 } |
320 | 315 |
321 } // namespace content | 316 } // namespace content |
OLD | NEW |