Chromium Code Reviews| Index: content/browser/accessibility/accessibility_tree_formatter.h |
| diff --git a/content/browser/accessibility/dump_accessibility_tree_helper.h b/content/browser/accessibility/accessibility_tree_formatter.h |
| similarity index 64% |
| rename from content/browser/accessibility/dump_accessibility_tree_helper.h |
| rename to content/browser/accessibility/accessibility_tree_formatter.h |
| index ff5883bb4cc5a250ff85fc7689b03f584c0ae9e7..45dee65d4aeaffc4702077ef241c571a41795cb0 100644 |
| --- a/content/browser/accessibility/dump_accessibility_tree_helper.h |
| +++ b/content/browser/accessibility/accessibility_tree_formatter.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_BROWSER_ACCESSIBILITY_DUMP_ACCESSIBILITY_TREE_HELPER_H_ |
| -#define CONTENT_BROWSER_ACCESSIBILITY_DUMP_ACCESSIBILITY_TREE_HELPER_H_ |
| +#ifndef CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_IMPL_H_ |
|
dmazzoni
2013/02/28 18:59:12
Get rid of _IMPL
aboxhall
2013/02/28 22:12:59
Done.
|
| +#define CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_IMPL_H_ |
| #include <vector> |
| @@ -14,17 +14,21 @@ |
| namespace content { |
| -// A utility class for retrieving platform specific accessibility information. |
| +class RenderViewHost; |
| + |
| +// A utility class for formatting platform-specific accessibility information, |
| +// for use in testing, debugging, and developer tools. |
| // This is extended by a subclass for each platform where accessibility is |
| // implemented. |
| -class DumpAccessibilityTreeHelper { |
| +class AccessibilityTreeFormatter { |
| public: |
| - DumpAccessibilityTreeHelper(); |
| - virtual ~DumpAccessibilityTreeHelper(); |
| + explicit AccessibilityTreeFormatter(BrowserAccessibility* node); |
| + virtual ~AccessibilityTreeFormatter(); |
| + |
| + static AccessibilityTreeFormatter* Create(RenderViewHost* rvh); |
| // Dumps a BrowserAccessibility tree into a string. |
| - void DumpAccessibilityTree(BrowserAccessibility* node, |
| - string16* contents); |
| + void FormatAccessibilityTree(string16* contents); |
| // A single filter specification. See GetAllowString() and GetDenyString() |
| // for more information. |
| @@ -50,8 +54,8 @@ class DumpAccessibilityTreeHelper { |
| // HTML test: test-file.html |
| // Expected: test-file-expected-mac.txt. |
| // Auto-generated: test-file-actual-mac.txt |
| - const base::FilePath::StringType GetActualFileSuffix() const; |
| - const base::FilePath::StringType GetExpectedFileSuffix() const; |
| + static const base::FilePath::StringType GetActualFileSuffix(); |
| + static const base::FilePath::StringType GetExpectedFileSuffix(); |
| // A platform-specific string that indicates a given line in a file |
| // is an allow-empty, allow or deny filter. Example: |
| @@ -66,14 +70,14 @@ class DumpAccessibilityTreeHelper { |
| // @MAC-DENY:subrole* |
| // --> |
| // <p>Text</p> |
| - const std::string GetAllowEmptyString() const; |
| - const std::string GetAllowString() const; |
| - const std::string GetDenyString() const; |
| + static const std::string GetAllowEmptyString(); |
| + static const std::string GetAllowString(); |
| + static const std::string GetDenyString(); |
| protected: |
| - void RecursiveDumpAccessibilityTree(BrowserAccessibility* node, |
| - string16* contents, |
| - int indent); |
| + void RecursiveFormatAccessibilityTree(BrowserAccessibility* node, |
| + string16* contents, |
| + int indent); |
| // Returns a platform specific representation of a BrowserAccessibility. |
| // Should be zero or more complete lines, each with |prefix| prepended |
| @@ -82,17 +86,18 @@ class DumpAccessibilityTreeHelper { |
| void Initialize(); |
| - bool MatchesFilters(const string16& text, bool default_result); |
| + bool MatchesFilters(const string16& text, bool default_result) const; |
| void StartLine(); |
| void Add(bool include_by_default, const string16& attr); |
| string16 FinishLine(); |
| + BrowserAccessibility* node_; |
| std::vector<Filter> filters_; |
| string16 line_; |
| - DISALLOW_COPY_AND_ASSIGN(DumpAccessibilityTreeHelper); |
| + DISALLOW_COPY_AND_ASSIGN(AccessibilityTreeFormatter); |
| }; |
| } // namespace content |
| -#endif // CONTENT_BROWSER_ACCESSIBILITY_DUMP_ACCESSIBILITY_TREE_HELPER_H_ |
| +#endif // CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TREE_FORMATTER_IMPL_H_ |