Chromium Code Reviews| Index: content/browser/accessibility/accessibility_tree_formatter.h |
| diff --git a/content/browser/accessibility/accessibility_tree_formatter.h b/content/browser/accessibility/accessibility_tree_formatter.h |
| index 39c6a4aa283c5473bad3c24ccbcfeb2a8346a49c..9ffe44f3c6cacd675b095fff484bec91901059e8 100644 |
| --- a/content/browser/accessibility/accessibility_tree_formatter.h |
| +++ b/content/browser/accessibility/accessibility_tree_formatter.h |
| @@ -27,8 +27,28 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { |
| explicit AccessibilityTreeFormatter(BrowserAccessibility* root); |
| virtual ~AccessibilityTreeFormatter(); |
| + // A single filter specification. See GetAllowString() and GetDenyString() |
| + // for more information. |
| + struct Filter { |
| + enum Type { |
| + ALLOW, |
| + ALLOW_EMPTY, |
| + DENY |
| + }; |
| + base::string16 match_str; |
| + Type type; |
| + |
| + Filter(base::string16 match_str, Type type) |
| + : match_str(match_str), type(type) {} |
| + }; |
| + |
| static AccessibilityTreeFormatter* Create(WebContents* wc); |
| + static bool MatchesFilters( |
| + const std::vector<Filter>& filters, |
| + const base::string16& text, |
| + bool default_result); |
| + |
| // Populates the given DictionaryValue with the accessibility tree. |
| // The dictionary contains a key/value pair for each attribute of the node, |
| // plus a "children" attribute containing a list of all child nodes. |
| @@ -54,25 +74,12 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { |
| // Dumps a BrowserAccessibility tree into a string. |
| void FormatAccessibilityTree(base::string16* contents); |
| - // A single filter specification. See GetAllowString() and GetDenyString() |
| - // for more information. |
| - struct Filter { |
| - enum Type { |
| - ALLOW, |
| - ALLOW_EMPTY, |
| - DENY |
| - }; |
| - base::string16 match_str; |
| - Type type; |
| - |
| - Filter(base::string16 match_str, Type type) |
| - : match_str(match_str), type(type) {} |
| - }; |
| - |
| // Set regular expression filters that apply to each component of every |
| // line before it's output. |
| void SetFilters(const std::vector<Filter>& filters); |
| + void set_show_ids(bool show_ids) { show_ids_ = show_ids; } |
|
David Tseng
2014/12/16 16:53:05
nit: document
dmazzoni
2014/12/16 23:26:32
Done.
|
| + |
| // Suffix of the expectation file corresponding to html file. |
| // Example: |
| // HTML test: test-file.html |
| @@ -119,10 +126,7 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { |
| const base::DictionaryValue& value); |
| // Returns a platform specific representation of a BrowserAccessibility. |
| - // Should be zero or more complete lines, each with |prefix| prepended |
| - // (to indent each line). |
| - base::string16 ToString(const base::DictionaryValue& node, |
| - const base::string16& indent); |
| + base::string16 ToString(const base::DictionaryValue& node); |
| void Initialize(); |
| @@ -141,6 +145,9 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { |
| // Filters used when formatting the accessibility tree as text. |
| std::vector<Filter> filters_; |
| + // Whether or not node ids should be included in the dump. |
| + bool show_ids_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AccessibilityTreeFormatter); |
| }; |