OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "AccessibilityObject.h" | 7 #include "AccessibilityObject.h" |
8 #include "EventHandler.h" | 8 #include "EventHandler.h" |
9 #include "FrameView.h" | 9 #include "FrameView.h" |
10 #include "PlatformKeyboardEvent.h" | 10 #include "PlatformKeyboardEvent.h" |
(...skipping 355 matching lines...) Loading... |
366 static WebAccessibility::Role SupportedRole(WebCore::AccessibilityRole role) { | 366 static WebAccessibility::Role SupportedRole(WebCore::AccessibilityRole role) { |
367 switch (role) { | 367 switch (role) { |
368 case WebCore::CellRole: | 368 case WebCore::CellRole: |
369 return WebAccessibility::ROLE_CELL; | 369 return WebAccessibility::ROLE_CELL; |
370 case WebCore::CheckBoxRole: | 370 case WebCore::CheckBoxRole: |
371 return WebAccessibility::ROLE_CHECKBUTTON; | 371 return WebAccessibility::ROLE_CHECKBUTTON; |
372 case WebCore::ColumnRole: | 372 case WebCore::ColumnRole: |
373 return WebAccessibility::ROLE_COLUMN; | 373 return WebAccessibility::ROLE_COLUMN; |
374 case WebCore::ColumnHeaderRole: | 374 case WebCore::ColumnHeaderRole: |
375 return WebAccessibility::ROLE_COLUMNHEADER; | 375 return WebAccessibility::ROLE_COLUMNHEADER; |
| 376 case WebCore::WebAreaRole: |
| 377 return WebAccessibility::ROLE_DOCUMENT; |
376 case WebCore::ImageMapRole: | 378 case WebCore::ImageMapRole: |
377 case WebCore::ImageRole: | 379 case WebCore::ImageRole: |
378 return WebAccessibility::ROLE_GRAPHIC; | 380 return WebAccessibility::ROLE_GRAPHIC; |
379 case WebCore::GroupRole: | 381 case WebCore::GroupRole: |
380 return WebAccessibility::ROLE_GROUPING; | 382 return WebAccessibility::ROLE_GROUPING; |
381 case WebCore::LinkRole: | 383 case WebCore::LinkRole: |
382 case WebCore::WebCoreLinkRole: | 384 case WebCore::WebCoreLinkRole: |
383 return WebAccessibility::ROLE_LINK; | 385 return WebAccessibility::ROLE_LINK; |
384 case WebCore::ListRole: | 386 case WebCore::ListRole: |
385 return WebAccessibility::ROLE_LIST; | 387 return WebAccessibility::ROLE_LIST; |
386 case WebCore::ListBoxRole: | 388 case WebCore::ListBoxRole: |
387 return WebAccessibility::ROLE_LISTBOX; | 389 return WebAccessibility::ROLE_LISTBOX; |
| 390 case WebCore::MenuBarRole: |
| 391 return WebAccessibility::ROLE_MENUBAR; |
388 case WebCore::MenuButtonRole: | 392 case WebCore::MenuButtonRole: |
389 case WebCore::MenuItemRole: | 393 case WebCore::MenuItemRole: |
390 return WebAccessibility::ROLE_MENUITEM; | 394 return WebAccessibility::ROLE_MENUITEM; |
391 case WebCore::MenuRole: | 395 case WebCore::MenuRole: |
392 return WebAccessibility::ROLE_MENUPOPUP; | 396 return WebAccessibility::ROLE_MENUPOPUP; |
393 case WebCore::OutlineRole: | 397 case WebCore::OutlineRole: |
394 return WebAccessibility::ROLE_OUTLINE; | 398 return WebAccessibility::ROLE_OUTLINE; |
395 case WebCore::TabGroupRole: | 399 case WebCore::TabGroupRole: |
396 return WebAccessibility::ROLE_PAGETABLIST; | 400 return WebAccessibility::ROLE_PAGETABLIST; |
397 case WebCore::ProgressIndicatorRole: | 401 case WebCore::ProgressIndicatorRole: |
398 return WebAccessibility::ROLE_PROGRESSBAR; | 402 return WebAccessibility::ROLE_PROGRESSBAR; |
399 case WebCore::ButtonRole: | 403 case WebCore::ButtonRole: |
400 return WebAccessibility::ROLE_PUSHBUTTON; | 404 return WebAccessibility::ROLE_PUSHBUTTON; |
401 case WebCore::RadioButtonRole: | 405 case WebCore::RadioButtonRole: |
402 return WebAccessibility::ROLE_RADIOBUTTON; | 406 return WebAccessibility::ROLE_RADIOBUTTON; |
403 case WebCore::RowRole: | 407 case WebCore::RowRole: |
404 return WebAccessibility::ROLE_ROW; | 408 return WebAccessibility::ROLE_ROW; |
405 case WebCore::RowHeaderRole: | 409 case WebCore::RowHeaderRole: |
406 return WebAccessibility::ROLE_ROWHEADER; | 410 return WebAccessibility::ROLE_ROWHEADER; |
407 case WebCore::SliderRole: | 411 case WebCore::SliderRole: |
408 return WebAccessibility::ROLE_SLIDER; | 412 return WebAccessibility::ROLE_SLIDER; |
409 case WebCore::StaticTextRole: | 413 case WebCore::StaticTextRole: |
410 return WebAccessibility::ROLE_STATICTEXT; | 414 return WebAccessibility::ROLE_STATICTEXT; |
411 case WebCore::TableRole: | 415 case WebCore::TableRole: |
412 return WebAccessibility::ROLE_TABLE; | 416 return WebAccessibility::ROLE_TABLE; |
413 case WebCore::ListMarkerRole: | 417 case WebCore::ListMarkerRole: |
414 case WebCore::TextFieldRole: | 418 case WebCore::TextFieldRole: |
415 case WebCore::TextAreaRole: | 419 case WebCore::TextAreaRole: |
416 return WebAccessibility::ROLE_TEXT; | 420 return WebAccessibility::ROLE_TEXT; |
| 421 case WebCore::ToolbarRole: |
| 422 return WebAccessibility::ROLE_TOOLBAR; |
417 case WebCore::UnknownRole: | 423 case WebCore::UnknownRole: |
418 default: | 424 default: |
419 // This is the default role. | 425 // This is the default role. |
420 return WebAccessibility::ROLE_CLIENT; | 426 return WebAccessibility::ROLE_CLIENT; |
421 } | 427 } |
422 } | 428 } |
423 | 429 |
424 WebAccessibility::Role GlueAccessibilityObject::role() const { | 430 WebAccessibility::Role GlueAccessibilityObject::role() const { |
425 return SupportedRole(m_object->roleValue()); | 431 return SupportedRole(m_object->roleValue()); |
426 } | 432 } |
(...skipping 26 matching lines...) Loading... |
453 if (!obj) | 459 if (!obj) |
454 return NULL; | 460 return NULL; |
455 | 461 |
456 GlueAccessibilityObject* result = | 462 GlueAccessibilityObject* result = |
457 static_cast<GlueAccessibilityObject*>(obj->wrapper()); | 463 static_cast<GlueAccessibilityObject*>(obj->wrapper()); |
458 if (!result) | 464 if (!result) |
459 result = CreateInstance(obj); | 465 result = CreateInstance(obj); |
460 | 466 |
461 return result; | 467 return result; |
462 } | 468 } |
OLD | NEW |