| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/views/accessibility_event_router_views.h" | 5 #include "chrome/browser/ui/views/accessibility_event_router_views.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 if (type == chrome::NOTIFICATION_ACCESSIBILITY_MENU_OPENED || | 128 if (type == chrome::NOTIFICATION_ACCESSIBILITY_MENU_OPENED || |
| 129 type == chrome::NOTIFICATION_ACCESSIBILITY_MENU_CLOSED) { | 129 type == chrome::NOTIFICATION_ACCESSIBILITY_MENU_CLOSED) { |
| 130 SendMenuNotification(view, type, profile); | 130 SendMenuNotification(view, type, profile); |
| 131 return; | 131 return; |
| 132 } | 132 } |
| 133 | 133 |
| 134 ui::AccessibleViewState state; | 134 ui::AccessibleViewState state; |
| 135 view->GetAccessibleState(&state); | 135 view->GetAccessibleState(&state); |
| 136 switch (state.role) { | 136 switch (state.role) { |
| 137 case ui::AccessibilityTypes::ROLE_ALERT: | 137 case ui::AccessibilityTypes::ROLE_ALERT: |
| 138 case ui::AccessibilityTypes::ROLE_WINDOW: |
| 138 SendWindowNotification(view, type, profile); | 139 SendWindowNotification(view, type, profile); |
| 139 break; | 140 break; |
| 140 case ui::AccessibilityTypes::ROLE_BUTTONMENU: | 141 case ui::AccessibilityTypes::ROLE_BUTTONMENU: |
| 141 case ui::AccessibilityTypes::ROLE_MENUBAR: | 142 case ui::AccessibilityTypes::ROLE_MENUBAR: |
| 142 case ui::AccessibilityTypes::ROLE_MENUPOPUP: | 143 case ui::AccessibilityTypes::ROLE_MENUPOPUP: |
| 143 SendMenuNotification(view, type, profile); | 144 SendMenuNotification(view, type, profile); |
| 144 break; | 145 break; |
| 145 case ui::AccessibilityTypes::ROLE_BUTTONDROPDOWN: | 146 case ui::AccessibilityTypes::ROLE_BUTTONDROPDOWN: |
| 146 case ui::AccessibilityTypes::ROLE_PUSHBUTTON: | 147 case ui::AccessibilityTypes::ROLE_PUSHBUTTON: |
| 147 SendButtonNotification(view, type, profile); | 148 SendButtonNotification(view, type, profile); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 return UTF16ToUTF8(state.name); | 439 return UTF16ToUTF8(state.name); |
| 439 | 440 |
| 440 for (int i = 0; i < view->child_count(); ++i) { | 441 for (int i = 0; i < view->child_count(); ++i) { |
| 441 views::View* child = view->child_at(i); | 442 views::View* child = view->child_at(i); |
| 442 std::string result = RecursiveGetStaticText(child); | 443 std::string result = RecursiveGetStaticText(child); |
| 443 if (!result.empty()) | 444 if (!result.empty()) |
| 444 return result; | 445 return result; |
| 445 } | 446 } |
| 446 return std::string(); | 447 return std::string(); |
| 447 } | 448 } |
| OLD | NEW |