OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EVENT_ROUTER_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_EVENT_ROUTER_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_EVENT_ROUTER_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_EVENT_ROUTER_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 AccessibilityEventRouterViews(); | 70 AccessibilityEventRouterViews(); |
71 virtual ~AccessibilityEventRouterViews(); | 71 virtual ~AccessibilityEventRouterViews(); |
72 | 72 |
73 friend struct DefaultSingletonTraits<AccessibilityEventRouterViews>; | 73 friend struct DefaultSingletonTraits<AccessibilityEventRouterViews>; |
74 FRIEND_TEST_ALL_PREFIXES(AccessibilityEventRouterViewsTest, | 74 FRIEND_TEST_ALL_PREFIXES(AccessibilityEventRouterViewsTest, |
75 TestFocusNotification); | 75 TestFocusNotification); |
76 | 76 |
77 // Checks the type of the view and calls one of the more specific | 77 // Checks the type of the view and calls one of the more specific |
78 // Send*Notification methods, below. | 78 // Send*Notification methods, below. |
79 void DispatchAccessibilityNotification( | 79 void DispatchAccessibilityNotification( |
80 views::View* view, int type); | 80 views::View* view, |
81 int type); | |
81 | 82 |
82 // Each of these methods constructs an AccessibilityControlInfo object | 83 // Each of these methods constructs an AccessibilityControlInfo object |
83 // and sends a notification of a specific accessibility event. | 84 // and sends a notification of a specific accessibility event. |
84 void SendButtonNotification( | 85 static void SendButtonNotification( |
85 views::View* view, int type, Profile* profile); | 86 views::View* view, int type, Profile* profile); |
86 void SendLinkNotification( | 87 static void SendLinkNotification( |
87 views::View* view, int type, Profile* profile); | 88 views::View* view, int type, Profile* profile); |
88 void SendMenuNotification( | 89 static void SendMenuNotification( |
89 views::View* view, int type, Profile* profile); | 90 views::View* view, int type, Profile* profile); |
90 void SendMenuItemNotification( | 91 static void SendMenuItemNotification( |
91 views::View* view, int type, Profile* profile); | 92 views::View* view, int type, Profile* profile); |
92 void SendTextfieldNotification( | 93 static void SendTextfieldNotification( |
93 views::View* view, int type, Profile* profile); | 94 views::View* view, int type, Profile* profile); |
94 void SendComboboxNotification( | 95 static void SendComboboxNotification( |
95 views::View* view, int type, Profile* profile); | 96 views::View* view, int type, Profile* profile); |
96 void SendCheckboxNotification( | 97 static void SendCheckboxNotification( |
97 views::View* view, int type, Profile* profile); | 98 views::View* view, int type, Profile* profile); |
98 void SendWindowNotification( | 99 static void SendWindowNotification( |
99 views::View* view, int type, Profile* profile); | 100 views::View* view, int type, Profile* profile); |
100 | 101 |
101 // Return the name of a view. | 102 // Return the name of a view. |
102 std::string GetViewName(views::View* view); | 103 static std::string GetViewName(views::View* view); |
104 | |
105 // Get the context of a view - the name of the enclosing group, toolbar, etc. | |
106 static std::string GetViewContext(views::View* view); | |
107 | |
108 // Return a descendant of this view with a given accessible role, if found. | |
109 static views::View* FindDescendantWithAccessibleRole( | |
110 views::View* view, | |
111 ui::AccessibilityTypes::Role role); | |
sky
2011/12/12 16:20:58
This is the preferred wrapping style when spanning
dmazzoni
2011/12/12 17:12:04
Done.
| |
103 | 112 |
104 // Return true if it's an event on a menu. | 113 // Return true if it's an event on a menu. |
105 bool IsMenuEvent(views::View* view, int type); | 114 static bool IsMenuEvent(views::View* view, |
115 int type); | |
106 | 116 |
107 // Recursively explore all menu items of |menu| and return in |count| | 117 // Recursively explore all menu items of |menu| and return in |count| |
108 // the total number of items, and in |index| the 0-based index of | 118 // the total number of items, and in |index| the 0-based index of |
109 // |item|, if found. Initialize |count| to zero before calling this | 119 // |item|, if found. Initialize |count| to zero before calling this |
110 // method. |index| will be unchanged if the item is not found, so | 120 // method. |index| will be unchanged if the item is not found, so |
111 // initialize it to -1 to detect this case. | 121 // initialize it to -1 to detect this case. |
112 void RecursiveGetMenuItemIndexAndCount( | 122 static void RecursiveGetMenuItemIndexAndCount(views::View* menu, |
113 views::View* menu, views::View* item, int* index, int* count); | 123 views::View* item, |
124 int* index, | |
125 int* count); | |
114 | 126 |
115 // Recursively explore the subviews and return the text from the first | 127 // Recursively explore the subviews and return the text from the first |
116 // subview with a role of STATIC_TEXT. | 128 // subview with a role of STATIC_TEXT. |
117 std::string RecursiveGetStaticText(views::View* view); | 129 static std::string RecursiveGetStaticText(views::View* view); |
118 | 130 |
119 // The profile associated with the most recent window event - used to | 131 // The profile associated with the most recent window event - used to |
120 // figure out where to route a few events that can't be directly traced | 132 // figure out where to route a few events that can't be directly traced |
121 // to a window with a profile (like menu events). | 133 // to a window with a profile (like menu events). |
122 Profile* most_recent_profile_; | 134 Profile* most_recent_profile_; |
123 }; | 135 }; |
124 | 136 |
125 #endif // CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_EVENT_ROUTER_VIEWS_H_ | 137 #endif // CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_EVENT_ROUTER_VIEWS_H_ |
OLD | NEW |