| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 AccessibilityEventRouterViews(); | 69 AccessibilityEventRouterViews(); |
| 70 virtual ~AccessibilityEventRouterViews(); | 70 virtual ~AccessibilityEventRouterViews(); |
| 71 | 71 |
| 72 friend struct DefaultSingletonTraits<AccessibilityEventRouterViews>; | 72 friend struct DefaultSingletonTraits<AccessibilityEventRouterViews>; |
| 73 FRIEND_TEST_ALL_PREFIXES(AccessibilityEventRouterViewsTest, | 73 FRIEND_TEST_ALL_PREFIXES(AccessibilityEventRouterViewsTest, |
| 74 TestFocusNotification); | 74 TestFocusNotification); |
| 75 | 75 |
| 76 // Checks the type of the view and calls one of the more specific | 76 // Checks the type of the view and calls one of the more specific |
| 77 // Send*Notification methods, below. | 77 // Send*Notification methods, below. |
| 78 void DispatchAccessibilityNotification( | 78 void DispatchAccessibilityNotification( |
| 79 views::View* view, NotificationType type); | 79 views::View* view, int type); |
| 80 | 80 |
| 81 // Return the name of a view. | 81 // Return the name of a view. |
| 82 std::string GetViewName(views::View* view); | 82 std::string GetViewName(views::View* view); |
| 83 | 83 |
| 84 // Each of these methods constructs an AccessibilityControlInfo object | 84 // Each of these methods constructs an AccessibilityControlInfo object |
| 85 // and sends a notification of a specific accessibility event. | 85 // and sends a notification of a specific accessibility event. |
| 86 void SendButtonNotification( | 86 void SendButtonNotification( |
| 87 views::View* view, NotificationType type, Profile* profile); | 87 views::View* view, int type, Profile* profile); |
| 88 void SendLinkNotification( | 88 void SendLinkNotification( |
| 89 views::View* view, NotificationType type, Profile* profile); | 89 views::View* view, int type, Profile* profile); |
| 90 void SendMenuNotification( | 90 void SendMenuNotification( |
| 91 views::View* view, NotificationType type, Profile* profile); | 91 views::View* view, int type, Profile* profile); |
| 92 void SendMenuItemNotification( | 92 void SendMenuItemNotification( |
| 93 views::View* view, NotificationType type, Profile* profile); | 93 views::View* view, int type, Profile* profile); |
| 94 void SendLocationBarNotification( | 94 void SendLocationBarNotification( |
| 95 views::View* view, NotificationType type, Profile* profile); | 95 views::View* view, int type, Profile* profile); |
| 96 void SendTextfieldNotification( | 96 void SendTextfieldNotification( |
| 97 views::View* view, NotificationType type, Profile* profile); | 97 views::View* view, int type, Profile* profile); |
| 98 void SendComboboxNotification( | 98 void SendComboboxNotification( |
| 99 views::View* view, NotificationType type, Profile* profile); | 99 views::View* view, int type, Profile* profile); |
| 100 void SendCheckboxNotification( | 100 void SendCheckboxNotification( |
| 101 views::View* view, NotificationType type, Profile* profile); | 101 views::View* view, int type, Profile* profile); |
| 102 | 102 |
| 103 // Return true if it's an event on a menu. | 103 // Return true if it's an event on a menu. |
| 104 bool IsMenuEvent(views::View* view, NotificationType type); | 104 bool IsMenuEvent(views::View* view, int type); |
| 105 | 105 |
| 106 // Recursively explore all menu items of |menu| and return in |count| | 106 // Recursively explore all menu items of |menu| and return in |count| |
| 107 // the total number of items, and in |index| the 0-based index of | 107 // the total number of items, and in |index| the 0-based index of |
| 108 // |item|, if found. Initialize |count| to zero before calling this | 108 // |item|, if found. Initialize |count| to zero before calling this |
| 109 // method. |index| will be unchanged if the item is not found, so | 109 // method. |index| will be unchanged if the item is not found, so |
| 110 // initialize it to -1 to detect this case. | 110 // initialize it to -1 to detect this case. |
| 111 void RecursiveGetMenuItemIndexAndCount( | 111 void RecursiveGetMenuItemIndexAndCount( |
| 112 views::View* menu, views::View* item, int* index, int* count); | 112 views::View* menu, views::View* item, int* index, int* count); |
| 113 | 113 |
| 114 // The profile associated with the most recent window event - used to | 114 // The profile associated with the most recent window event - used to |
| 115 // figure out where to route a few events that can't be directly traced | 115 // figure out where to route a few events that can't be directly traced |
| 116 // to a window with a profile (like menu events). | 116 // to a window with a profile (like menu events). |
| 117 Profile* most_recent_profile_; | 117 Profile* most_recent_profile_; |
| 118 | 118 |
| 119 // Used to defer handling of some events until the next time | 119 // Used to defer handling of some events until the next time |
| 120 // through the event loop. | 120 // through the event loop. |
| 121 ScopedRunnableMethodFactory<AccessibilityEventRouterViews> method_factory_; | 121 ScopedRunnableMethodFactory<AccessibilityEventRouterViews> method_factory_; |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 #endif // CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_EVENT_ROUTER_VIEWS_H_ | 124 #endif // CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_EVENT_ROUTER_VIEWS_H_ |
| OLD | NEW |