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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/strings/pattern.h" | 11 #include "base/strings/pattern.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "content/browser/accessibility/browser_accessibility_manager.h" | 16 #include "content/browser/accessibility/browser_accessibility_manager.h" |
17 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 17 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
18 #include "content/browser/web_contents/web_contents_impl.h" | 18 #include "content/browser/web_contents/web_contents_impl.h" |
19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
20 | 20 |
21 namespace content { | 21 namespace content { |
| 22 |
22 namespace { | 23 namespace { |
| 24 |
23 const char kIndentSymbol = '+'; | 25 const char kIndentSymbol = '+'; |
24 const int kIndentSymbolCount = 2; | 26 const int kIndentSymbolCount = 2; |
25 const char* kSkipString = "@NO_DUMP"; | 27 const char kSkipString[] = "@NO_DUMP"; |
26 const char* kSkipChildren = "@NO_CHILDREN_DUMP"; | 28 const char kSkipChildren[] = "@NO_CHILDREN_DUMP"; |
27 const char* kChildrenDictAttr = "children"; | 29 const char kChildrenDictAttr[] = "children"; |
28 } | 30 |
| 31 } // namespace |
29 | 32 |
30 AccessibilityTreeFormatter::AccessibilityTreeFormatter() | 33 AccessibilityTreeFormatter::AccessibilityTreeFormatter() |
31 : show_ids_(false) { | 34 : show_ids_(false) { |
32 } | 35 } |
33 | 36 |
34 AccessibilityTreeFormatter::~AccessibilityTreeFormatter() { | 37 AccessibilityTreeFormatter::~AccessibilityTreeFormatter() { |
35 } | 38 } |
36 | 39 |
37 scoped_ptr<base::DictionaryValue> | 40 scoped_ptr<base::DictionaryValue> |
38 AccessibilityTreeFormatter::BuildAccessibilityTree( | 41 AccessibilityTreeFormatter::BuildAccessibilityTree( |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 if (attr.empty()) | 150 if (attr.empty()) |
148 return; | 151 return; |
149 if (!MatchesFilters(attr, include_by_default)) | 152 if (!MatchesFilters(attr, include_by_default)) |
150 return; | 153 return; |
151 if (!line->empty()) | 154 if (!line->empty()) |
152 *line += base::ASCIIToUTF16(" "); | 155 *line += base::ASCIIToUTF16(" "); |
153 *line += attr; | 156 *line += attr; |
154 } | 157 } |
155 | 158 |
156 } // namespace content | 159 } // namespace content |
OLD | NEW |