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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/pattern.h" | 9 #include "base/strings/pattern.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 const base::ListValue* children; | 92 const base::ListValue* children; |
93 dict.GetList(kChildrenDictAttr, &children); | 93 dict.GetList(kChildrenDictAttr, &children); |
94 const base::DictionaryValue* child_dict; | 94 const base::DictionaryValue* child_dict; |
95 for (size_t i = 0; i < children->GetSize(); i++) { | 95 for (size_t i = 0; i < children->GetSize(); i++) { |
96 children->GetDictionary(i, &child_dict); | 96 children->GetDictionary(i, &child_dict); |
97 RecursiveFormatAccessibilityTree(*child_dict, contents, depth + 1); | 97 RecursiveFormatAccessibilityTree(*child_dict, contents, depth + 1); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 #if (!defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_ANDROID)) | 101 #if !defined(OS_WIN) && \ |
| 102 !defined(OS_MACOSX) && \ |
| 103 !defined(OS_ANDROID) && \ |
| 104 !(defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_X11)) |
102 void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, | 105 void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, |
103 base::DictionaryValue* dict) { | 106 base::DictionaryValue* dict) { |
104 dict->SetInteger("id", node.GetId()); | 107 dict->SetInteger("id", node.GetId()); |
105 } | 108 } |
106 | 109 |
107 base::string16 AccessibilityTreeFormatter::ToString( | 110 base::string16 AccessibilityTreeFormatter::ToString( |
108 const base::DictionaryValue& node) { | 111 const base::DictionaryValue& node) { |
109 int id_value; | 112 int id_value; |
110 node.GetInteger("id", &id_value); | 113 node.GetInteger("id", &id_value); |
111 return base::IntToString16(id_value); | 114 return base::IntToString16(id_value); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 if (attr.empty()) | 195 if (attr.empty()) |
193 return; | 196 return; |
194 if (!MatchesFilters(attr, include_by_default)) | 197 if (!MatchesFilters(attr, include_by_default)) |
195 return; | 198 return; |
196 if (!line->empty()) | 199 if (!line->empty()) |
197 *line += base::ASCIIToUTF16(" "); | 200 *line += base::ASCIIToUTF16(" "); |
198 *line += attr; | 201 *line += attr; |
199 } | 202 } |
200 | 203 |
201 } // namespace content | 204 } // namespace content |
OLD | NEW |