| 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/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 *contents += line; | 85 *contents += line; |
| 86 const base::ListValue* children; | 86 const base::ListValue* children; |
| 87 dict.GetList(kChildrenDictAttr, &children); | 87 dict.GetList(kChildrenDictAttr, &children); |
| 88 const base::DictionaryValue* child_dict; | 88 const base::DictionaryValue* child_dict; |
| 89 for (size_t i = 0; i < children->GetSize(); i++) { | 89 for (size_t i = 0; i < children->GetSize(); i++) { |
| 90 children->GetDictionary(i, &child_dict); | 90 children->GetDictionary(i, &child_dict); |
| 91 RecursiveFormatAccessibilityTree(*child_dict, contents, depth + 1); | 91 RecursiveFormatAccessibilityTree(*child_dict, contents, depth + 1); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 #if (!defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_ANDROID) && \ | 95 #if (!defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_ANDROID)) |
| 96 !defined(TOOLKIT_GTK)) | |
| 97 void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, | 96 void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, |
| 98 base::DictionaryValue* dict) { | 97 base::DictionaryValue* dict) { |
| 99 dict->SetInteger("id", node.GetId()); | 98 dict->SetInteger("id", node.GetId()); |
| 100 } | 99 } |
| 101 | 100 |
| 102 base::string16 AccessibilityTreeFormatter::ToString( | 101 base::string16 AccessibilityTreeFormatter::ToString( |
| 103 const base::DictionaryValue& node, | 102 const base::DictionaryValue& node, |
| 104 const base::string16& indent) { | 103 const base::string16& indent) { |
| 105 int id_value; | 104 int id_value; |
| 106 node.GetInteger("id", &id_value); | 105 node.GetInteger("id", &id_value); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 if (attr.empty()) | 180 if (attr.empty()) |
| 182 return; | 181 return; |
| 183 if (!MatchesFilters(attr, include_by_default)) | 182 if (!MatchesFilters(attr, include_by_default)) |
| 184 return; | 183 return; |
| 185 if (!line->empty()) | 184 if (!line->empty()) |
| 186 *line += base::ASCIIToUTF16(" "); | 185 *line += base::ASCIIToUTF16(" "); |
| 187 *line += attr; | 186 *line += attr; |
| 188 } | 187 } |
| 189 | 188 |
| 190 } // namespace content | 189 } // namespace content |
| OLD | NEW |