Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc

Issue 393033006: Added tab notification to accessibility_event_router_views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tab index -1 isn't read Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/accessibility_event_router_views .h" 5 #include "chrome/browser/ui/views/accessibility/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/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 SendMenuItemNotification(view, type, profile); 205 SendMenuItemNotification(view, type, profile);
206 break; 206 break;
207 case ui::AX_ROLE_RADIO_BUTTON: 207 case ui::AX_ROLE_RADIO_BUTTON:
208 // Not used anymore? 208 // Not used anymore?
209 case ui::AX_ROLE_SLIDER: 209 case ui::AX_ROLE_SLIDER:
210 SendSliderNotification(view, type, profile); 210 SendSliderNotification(view, type, profile);
211 break; 211 break;
212 case ui::AX_ROLE_TREE: 212 case ui::AX_ROLE_TREE:
213 SendTreeNotification(view, type, profile); 213 SendTreeNotification(view, type, profile);
214 break; 214 break;
215 case ui::AX_ROLE_TAB:
216 SendTabNotification(view, type, profile);
217 break;
215 case ui::AX_ROLE_TREE_ITEM: 218 case ui::AX_ROLE_TREE_ITEM:
216 SendTreeItemNotification(view, type, profile); 219 SendTreeItemNotification(view, type, profile);
217 break; 220 break;
218 default: 221 default:
219 // Hover events can fire on literally any view, so it's safe to 222 // Hover events can fire on literally any view, so it's safe to
220 // ignore ones we don't care about. 223 // ignore ones we don't care about.
221 if (type == ui::AX_EVENT_HOVER) 224 if (type == ui::AX_EVENT_HOVER)
222 break; 225 break;
223 226
224 // If this is encountered, please file a bug with the role that wasn't 227 // If this is encountered, please file a bug with the role that wasn't
225 // caught so we can add accessibility extension API support. 228 // caught so we can add accessibility extension API support.
226 NOTREACHED(); 229 NOTREACHED();
227 } 230 }
228 } 231 }
229 232
230 // static 233 // static
234 void AccessibilityEventRouterViews::SendTabNotification(
235 views::View* view,
236 ui::AXEvent event,
237 Profile* profile) {
238 ui::AXViewState state;
239 view->GetAccessibleState(&state);
240 if (state.index == -1)
241 return;
242 std::string name = base::UTF16ToUTF8(state.name);
243 std::string context = GetViewContext(view);
244 AccessibilityTabInfo info(profile, name, context, state.index, state.count);
245 SendControlAccessibilityNotification(event, &info);
246 }
247
248 // static
231 void AccessibilityEventRouterViews::SendButtonNotification( 249 void AccessibilityEventRouterViews::SendButtonNotification(
232 views::View* view, 250 views::View* view,
233 ui::AXEvent event, 251 ui::AXEvent event,
234 Profile* profile) { 252 Profile* profile) {
235 AccessibilityButtonInfo info( 253 AccessibilityButtonInfo info(
236 profile, GetViewName(view), GetViewContext(view)); 254 profile, GetViewName(view), GetViewContext(view));
237 SendControlAccessibilityNotification(event, &info); 255 SendControlAccessibilityNotification(event, &info);
238 } 256 }
239 257
240 // static 258 // static
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 return base::UTF16ToUTF8(state.name); 563 return base::UTF16ToUTF8(state.name);
546 564
547 for (int i = 0; i < view->child_count(); ++i) { 565 for (int i = 0; i < view->child_count(); ++i) {
548 views::View* child = view->child_at(i); 566 views::View* child = view->child_at(i);
549 std::string result = RecursiveGetStaticText(child); 567 std::string result = RecursiveGetStaticText(child);
550 if (!result.empty()) 568 if (!result.empty())
551 return result; 569 return result;
552 } 570 }
553 return std::string(); 571 return std::string();
554 } 572 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/accessibility/accessibility_event_router_views.h ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698