| 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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 void RecursiveBuildAccessibilityTree(const BrowserAccessibility& node, | 105 void RecursiveBuildAccessibilityTree(const BrowserAccessibility& node, |
| 106 DictionaryValue* tree_node); | 106 DictionaryValue* tree_node); |
| 107 void RecursiveFormatAccessibilityTree(const DictionaryValue& tree_node, | 107 void RecursiveFormatAccessibilityTree(const DictionaryValue& tree_node, |
| 108 string16* contents, | 108 string16* contents, |
| 109 int depth = 0); | 109 int depth = 0); |
| 110 | 110 |
| 111 // Overridden by each platform to add the required attributes for each node | 111 // Overridden by each platform to add the required attributes for each node |
| 112 // into the given dict. | 112 // into the given dict. |
| 113 void AddProperties(const BrowserAccessibility& node, DictionaryValue* dict); | 113 void AddProperties(const BrowserAccessibility& node, DictionaryValue* dict); |
| 114 | 114 |
| 115 // Returns true by default; can be overridden by the platform to |
| 116 // prune some children from the tree when they wouldn't be exposed |
| 117 // natively on that platform. |
| 118 virtual bool IncludeChildren(const BrowserAccessibility& node); |
| 119 |
| 115 string16 FormatCoordinates(const char* name, | 120 string16 FormatCoordinates(const char* name, |
| 116 const char* x_name, | 121 const char* x_name, |
| 117 const char* y_name, | 122 const char* y_name, |
| 118 const DictionaryValue& value); | 123 const DictionaryValue& value); |
| 119 | 124 |
| 120 // Returns a platform specific representation of a BrowserAccessibility. | 125 // Returns a platform specific representation of a BrowserAccessibility. |
| 121 // Should be zero or more complete lines, each with |prefix| prepended | 126 // Should be zero or more complete lines, each with |prefix| prepended |
| 122 // (to indent each line). | 127 // (to indent each line). |
| 123 string16 ToString(const DictionaryValue& node, const string16& indent); | 128 string16 ToString(const DictionaryValue& node, const string16& indent); |
| 124 | 129 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 138 | 143 |
| 139 // Filters used when formatting the accessibility tree as text. | 144 // Filters used when formatting the accessibility tree as text. |
| 140 std::vector<Filter> filters_; | 145 std::vector<Filter> filters_; |
| 141 | 146 |
| 142 DISALLOW_COPY_AND_ASSIGN(AccessibilityTreeFormatter); | 147 DISALLOW_COPY_AND_ASSIGN(AccessibilityTreeFormatter); |
| 143 }; | 148 }; |
| 144 | 149 |
| 145 } // namespace content | 150 } // namespace content |
| 146 | 151 |
| 147 #endif // CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_H_ | 152 #endif // CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_H_ |
| OLD | NEW |