| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/renderer/accessibility/blink_ax_enum_conversion.h" | 5 #include "content/renderer/accessibility/blink_ax_enum_conversion.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 browser_text_style |= ui::AX_TEXT_STYLE_BOLD; | 427 browser_text_style |= ui::AX_TEXT_STYLE_BOLD; |
| 428 if (text_style & blink::WebAXTextStyleItalic) | 428 if (text_style & blink::WebAXTextStyleItalic) |
| 429 browser_text_style |= ui::AX_TEXT_STYLE_ITALIC; | 429 browser_text_style |= ui::AX_TEXT_STYLE_ITALIC; |
| 430 if (text_style & blink::WebAXTextStyleUnderline) | 430 if (text_style & blink::WebAXTextStyleUnderline) |
| 431 browser_text_style |= ui::AX_TEXT_STYLE_UNDERLINE; | 431 browser_text_style |= ui::AX_TEXT_STYLE_UNDERLINE; |
| 432 if (text_style & blink::WebAXTextStyleLineThrough) | 432 if (text_style & blink::WebAXTextStyleLineThrough) |
| 433 browser_text_style |= ui::AX_TEXT_STYLE_LINE_THROUGH; | 433 browser_text_style |= ui::AX_TEXT_STYLE_LINE_THROUGH; |
| 434 return static_cast<ui::AXTextStyle>(browser_text_style); | 434 return static_cast<ui::AXTextStyle>(browser_text_style); |
| 435 } | 435 } |
| 436 | 436 |
| 437 ui::AXAriaCurrent AXAriaCurrentFromBlink(blink::WebAXAriaCurrent aria_current) { |
| 438 switch (aria_current) { |
| 439 case blink::WebAXAriaCurrentUndefined: |
| 440 return ui::AX_ARIA_CURRENT_NONE; |
| 441 case blink::WebAXAriaCurrentFalse: |
| 442 return ui::AX_ARIA_CURRENT_FALSE; |
| 443 case blink::WebAXAriaCurrentTrue: |
| 444 return ui::AX_ARIA_CURRENT_TRUE; |
| 445 case blink::WebAXAriaCurrentPage: |
| 446 return ui::AX_ARIA_CURRENT_PAGE; |
| 447 case blink::WebAXAriaCurrentStep: |
| 448 return ui::AX_ARIA_CURRENT_STEP; |
| 449 case blink::WebAXAriaCurrentLocation: |
| 450 return ui::AX_ARIA_CURRENT_LOCATION; |
| 451 case blink::WebAXAriaCurrentDate: |
| 452 return ui::AX_ARIA_CURRENT_DATE; |
| 453 case blink::WebAXAriaCurrentTime: |
| 454 return ui::AX_ARIA_CURRENT_TIME; |
| 455 } |
| 456 |
| 457 NOTREACHED(); |
| 458 return ui::AX_ARIA_CURRENT_NONE; |
| 459 } |
| 460 |
| 437 ui::AXInvalidState AXInvalidStateFromBlink( | 461 ui::AXInvalidState AXInvalidStateFromBlink( |
| 438 blink::WebAXInvalidState invalid_state) { | 462 blink::WebAXInvalidState invalid_state) { |
| 439 switch (invalid_state) { | 463 switch (invalid_state) { |
| 440 case blink::WebAXInvalidStateUndefined: | 464 case blink::WebAXInvalidStateUndefined: |
| 441 return ui::AX_INVALID_STATE_NONE; | 465 return ui::AX_INVALID_STATE_NONE; |
| 442 case blink::WebAXInvalidStateFalse: | 466 case blink::WebAXInvalidStateFalse: |
| 443 return ui::AX_INVALID_STATE_FALSE; | 467 return ui::AX_INVALID_STATE_FALSE; |
| 444 case blink::WebAXInvalidStateTrue: | 468 case blink::WebAXInvalidStateTrue: |
| 445 return ui::AX_INVALID_STATE_TRUE; | 469 return ui::AX_INVALID_STATE_TRUE; |
| 446 case blink::WebAXInvalidStateSpelling: | 470 case blink::WebAXInvalidStateSpelling: |
| 447 return ui::AX_INVALID_STATE_SPELLING; | 471 return ui::AX_INVALID_STATE_SPELLING; |
| 448 case blink::WebAXInvalidStateGrammar: | 472 case blink::WebAXInvalidStateGrammar: |
| 449 return ui::AX_INVALID_STATE_GRAMMAR; | 473 return ui::AX_INVALID_STATE_GRAMMAR; |
| 450 case blink::WebAXInvalidStateOther: | 474 case blink::WebAXInvalidStateOther: |
| 451 return ui::AX_INVALID_STATE_OTHER; | 475 return ui::AX_INVALID_STATE_OTHER; |
| 452 default: | |
| 453 NOTREACHED(); | |
| 454 } | 476 } |
| 455 | 477 |
| 478 NOTREACHED(); |
| 456 return ui::AX_INVALID_STATE_NONE; | 479 return ui::AX_INVALID_STATE_NONE; |
| 457 } | 480 } |
| 458 | 481 |
| 459 ui::AXSortDirection AXSortDirectionFromBlink( | 482 ui::AXSortDirection AXSortDirectionFromBlink( |
| 460 blink::WebAXSortDirection sort_direction) { | 483 blink::WebAXSortDirection sort_direction) { |
| 461 switch (sort_direction) { | 484 switch (sort_direction) { |
| 462 case blink::WebAXSortDirectionUndefined: | 485 case blink::WebAXSortDirectionUndefined: |
| 463 return ui::AX_SORT_DIRECTION_NONE; | 486 return ui::AX_SORT_DIRECTION_NONE; |
| 464 case blink::WebAXSortDirectionNone: | 487 case blink::WebAXSortDirectionNone: |
| 465 return ui::AX_SORT_DIRECTION_UNSORTED; | 488 return ui::AX_SORT_DIRECTION_UNSORTED; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 case blink::WebAXDescriptionFromRelatedElement: | 538 case blink::WebAXDescriptionFromRelatedElement: |
| 516 return ui::AX_DESCRIPTION_FROM_RELATED_ELEMENT; | 539 return ui::AX_DESCRIPTION_FROM_RELATED_ELEMENT; |
| 517 default: | 540 default: |
| 518 NOTREACHED(); | 541 NOTREACHED(); |
| 519 } | 542 } |
| 520 | 543 |
| 521 return ui::AX_DESCRIPTION_FROM_UNINITIALIZED; | 544 return ui::AX_DESCRIPTION_FROM_UNINITIALIZED; |
| 522 } | 545 } |
| 523 | 546 |
| 524 } // namespace content. | 547 } // namespace content. |
| OLD | NEW |