| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_AUTOMATION_MANAGER_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_ACCESSIBILITY_AUTOMATION_MANAGER_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_AUTOMATION_MANAGER_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_ASH_ACCESSIBILITY_AUTOMATION_MANAGER_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 | 10 |
| 11 #include "chrome/browser/ui/ash/accessibility/ax_tree_source_views.h" |
| 11 #include "ui/accessibility/ax_tree_serializer.h" | 12 #include "ui/accessibility/ax_tree_serializer.h" |
| 12 #include "ui/views/accessibility/ax_tree_source_views.h" | |
| 13 | 13 |
| 14 template <typename T> struct DefaultSingletonTraits; | 14 template <typename T> struct DefaultSingletonTraits; |
| 15 | 15 |
| 16 class Profile; | 16 class Profile; |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 class AXAuraObjWrapper; |
| 19 class View; | 20 class View; |
| 20 } // namespace views | 21 } // namespace views |
| 21 | 22 |
| 22 // Manages a tree of automation nodes. | 23 // Manages a tree of automation nodes. |
| 23 class AutomationManagerViews { | 24 class AutomationManagerViews { |
| 24 public: | 25 public: |
| 25 // Get the single instance of this class. | 26 // Get the single instance of this class. |
| 26 static AutomationManagerViews* GetInstance(); | 27 static AutomationManagerViews* GetInstance(); |
| 27 | 28 |
| 29 // Enable automation support for views. |
| 30 void Enable(); |
| 31 |
| 32 // Disable automation support for views. |
| 33 void Disable(); |
| 34 |
| 28 // Handle an event fired upon a |View|. | 35 // Handle an event fired upon a |View|. |
| 29 void HandleEvent(Profile* profile, views::View* view, ui::AXEvent event_type); | 36 void HandleEvent(Profile* profile, views::View* view, ui::AXEvent event_type); |
| 30 | 37 |
| 31 private: | 38 private: |
| 32 friend struct DefaultSingletonTraits<AutomationManagerViews>; | 39 friend struct DefaultSingletonTraits<AutomationManagerViews>; |
| 33 | 40 |
| 34 AutomationManagerViews(); | 41 AutomationManagerViews(); |
| 35 ~AutomationManagerViews(); | 42 ~AutomationManagerViews(); |
| 36 | 43 |
| 44 // Whether Views-based automation is enabled. |
| 45 bool enabled_; |
| 46 |
| 37 // Holds the active views-based accessibility tree. A tree currently consists | 47 // Holds the active views-based accessibility tree. A tree currently consists |
| 38 // of all views descendant to a |Widget| (see |AXTreeSourceViews|). | 48 // of all views descendant to a |Widget| (see |AXTreeSourceViews|). |
| 39 // A tree becomes active when an event is fired on a descendant view. | 49 // A tree becomes active when an event is fired on a descendant view. |
| 40 scoped_ptr <views::AXTreeSourceViews> current_tree_; | 50 scoped_ptr <AXTreeSourceViews> current_tree_; |
| 41 | 51 |
| 42 // Serializes incremental updates on the currently active tree | 52 // Serializes incremental updates on the currently active tree |
| 43 // |current_tree_|. | 53 // |current_tree_|. |
| 44 scoped_ptr<ui::AXTreeSerializer<views::View*> > current_tree_serializer_; | 54 scoped_ptr<ui::AXTreeSerializer<views::AXAuraObjWrapper*> > |
| 55 current_tree_serializer_; |
| 45 | 56 |
| 46 DISALLOW_COPY_AND_ASSIGN(AutomationManagerViews); | 57 DISALLOW_COPY_AND_ASSIGN(AutomationManagerViews); |
| 47 }; | 58 }; |
| 48 | 59 |
| 49 #endif // CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_AUTOMATION_MANAGER_VIEWS_H_ | 60 #endif // CHROME_BROWSER_UI_ASH_ACCESSIBILITY_AUTOMATION_MANAGER_VIEWS_H_ |
| OLD | NEW |