| 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::AXAriaCurrentState AXAriaCurrentStateFromBlink( |
| 438 blink::WebAXAriaCurrentState aria_current_state) { |
| 439 switch (aria_current_state) { |
| 440 case blink::WebAXAriaCurrentStateUndefined: |
| 441 return ui::AX_ARIA_CURRENT_STATE_NONE; |
| 442 case blink::WebAXAriaCurrentStateFalse: |
| 443 return ui::AX_ARIA_CURRENT_STATE_FALSE; |
| 444 case blink::WebAXAriaCurrentStateTrue: |
| 445 return ui::AX_ARIA_CURRENT_STATE_TRUE; |
| 446 case blink::WebAXAriaCurrentStatePage: |
| 447 return ui::AX_ARIA_CURRENT_STATE_PAGE; |
| 448 case blink::WebAXAriaCurrentStateStep: |
| 449 return ui::AX_ARIA_CURRENT_STATE_STEP; |
| 450 case blink::WebAXAriaCurrentStateLocation: |
| 451 return ui::AX_ARIA_CURRENT_STATE_LOCATION; |
| 452 case blink::WebAXAriaCurrentStateDate: |
| 453 return ui::AX_ARIA_CURRENT_STATE_DATE; |
| 454 case blink::WebAXAriaCurrentStateTime: |
| 455 return ui::AX_ARIA_CURRENT_STATE_TIME; |
| 456 } |
| 457 |
| 458 NOTREACHED(); |
| 459 return ui::AX_ARIA_CURRENT_STATE_NONE; |
| 460 } |
| 461 |
| 437 ui::AXInvalidState AXInvalidStateFromBlink( | 462 ui::AXInvalidState AXInvalidStateFromBlink( |
| 438 blink::WebAXInvalidState invalid_state) { | 463 blink::WebAXInvalidState invalid_state) { |
| 439 switch (invalid_state) { | 464 switch (invalid_state) { |
| 440 case blink::WebAXInvalidStateUndefined: | 465 case blink::WebAXInvalidStateUndefined: |
| 441 return ui::AX_INVALID_STATE_NONE; | 466 return ui::AX_INVALID_STATE_NONE; |
| 442 case blink::WebAXInvalidStateFalse: | 467 case blink::WebAXInvalidStateFalse: |
| 443 return ui::AX_INVALID_STATE_FALSE; | 468 return ui::AX_INVALID_STATE_FALSE; |
| 444 case blink::WebAXInvalidStateTrue: | 469 case blink::WebAXInvalidStateTrue: |
| 445 return ui::AX_INVALID_STATE_TRUE; | 470 return ui::AX_INVALID_STATE_TRUE; |
| 446 case blink::WebAXInvalidStateSpelling: | 471 case blink::WebAXInvalidStateSpelling: |
| 447 return ui::AX_INVALID_STATE_SPELLING; | 472 return ui::AX_INVALID_STATE_SPELLING; |
| 448 case blink::WebAXInvalidStateGrammar: | 473 case blink::WebAXInvalidStateGrammar: |
| 449 return ui::AX_INVALID_STATE_GRAMMAR; | 474 return ui::AX_INVALID_STATE_GRAMMAR; |
| 450 case blink::WebAXInvalidStateOther: | 475 case blink::WebAXInvalidStateOther: |
| 451 return ui::AX_INVALID_STATE_OTHER; | 476 return ui::AX_INVALID_STATE_OTHER; |
| 452 default: | |
| 453 NOTREACHED(); | |
| 454 } | 477 } |
| 455 | 478 |
| 479 NOTREACHED(); |
| 456 return ui::AX_INVALID_STATE_NONE; | 480 return ui::AX_INVALID_STATE_NONE; |
| 457 } | 481 } |
| 458 | 482 |
| 459 ui::AXSortDirection AXSortDirectionFromBlink( | 483 ui::AXSortDirection AXSortDirectionFromBlink( |
| 460 blink::WebAXSortDirection sort_direction) { | 484 blink::WebAXSortDirection sort_direction) { |
| 461 switch (sort_direction) { | 485 switch (sort_direction) { |
| 462 case blink::WebAXSortDirectionUndefined: | 486 case blink::WebAXSortDirectionUndefined: |
| 463 return ui::AX_SORT_DIRECTION_NONE; | 487 return ui::AX_SORT_DIRECTION_NONE; |
| 464 case blink::WebAXSortDirectionNone: | 488 case blink::WebAXSortDirectionNone: |
| 465 return ui::AX_SORT_DIRECTION_UNSORTED; | 489 return ui::AX_SORT_DIRECTION_UNSORTED; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 case blink::WebAXDescriptionFromRelatedElement: | 539 case blink::WebAXDescriptionFromRelatedElement: |
| 516 return ui::AX_DESCRIPTION_FROM_RELATED_ELEMENT; | 540 return ui::AX_DESCRIPTION_FROM_RELATED_ELEMENT; |
| 517 default: | 541 default: |
| 518 NOTREACHED(); | 542 NOTREACHED(); |
| 519 } | 543 } |
| 520 | 544 |
| 521 return ui::AX_DESCRIPTION_FROM_UNINITIALIZED; | 545 return ui::AX_DESCRIPTION_FROM_UNINITIALIZED; |
| 522 } | 546 } |
| 523 | 547 |
| 524 } // namespace content. | 548 } // namespace content. |
| OLD | NEW |