| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ui/accessibility/ax_node_data.h" | 5 #include "ui/accessibility/ax_node_data.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 case AX_TEXT_DIRECTION_RTL: | 423 case AX_TEXT_DIRECTION_RTL: |
| 424 result += " text_direction=rtl"; | 424 result += " text_direction=rtl"; |
| 425 break; | 425 break; |
| 426 case AX_TEXT_DIRECTION_TTB: | 426 case AX_TEXT_DIRECTION_TTB: |
| 427 result += " text_direction=ttb"; | 427 result += " text_direction=ttb"; |
| 428 break; | 428 break; |
| 429 case AX_TEXT_DIRECTION_BTT: | 429 case AX_TEXT_DIRECTION_BTT: |
| 430 result += " text_direction=btt"; | 430 result += " text_direction=btt"; |
| 431 break; | 431 break; |
| 432 } | 432 } |
| 433 case AX_ATTR_TEXT_STYLE: { | |
| 434 unsigned int text_style = int_attributes[i].second; | |
| 435 if (text_style == AX_TEXT_STYLE_NONE) | |
| 436 break; | |
| 437 std::string text_style_value(" text_style="); | |
| 438 if (text_style & AX_TEXT_STYLE_BOLD) | |
| 439 text_style_value += "bold,"; | |
| 440 if (text_style & AX_TEXT_STYLE_ITALIC) | |
| 441 text_style_value += "italic,"; | |
| 442 if (text_style & AX_TEXT_STYLE_UNDERLINE) | |
| 443 text_style_value += "underline,"; | |
| 444 if (text_style & AX_TEXT_STYLE_LINE_THROUGH) | |
| 445 text_style_value += "line-through,"; | |
| 446 result += text_style_value.substr(0, text_style_value.size() - 1);; | |
| 447 } | |
| 448 break; | 433 break; |
| 434 case AX_ATTR_TEXT_STYLE: { |
| 435 unsigned int text_style = int_attributes[i].second; |
| 436 if (text_style == AX_TEXT_STYLE_NONE) |
| 437 break; |
| 438 std::string text_style_value(" text_style="); |
| 439 if (text_style & AX_TEXT_STYLE_BOLD) |
| 440 text_style_value += "bold,"; |
| 441 if (text_style & AX_TEXT_STYLE_ITALIC) |
| 442 text_style_value += "italic,"; |
| 443 if (text_style & AX_TEXT_STYLE_UNDERLINE) |
| 444 text_style_value += "underline,"; |
| 445 if (text_style & AX_TEXT_STYLE_LINE_THROUGH) |
| 446 text_style_value += "line-through,"; |
| 447 result += text_style_value.substr(0, text_style_value.size() - 1); |
| 448 break; |
| 449 } |
| 449 case AX_ATTR_SET_SIZE: | 450 case AX_ATTR_SET_SIZE: |
| 450 result += " setsize=" + value; | 451 result += " setsize=" + value; |
| 451 break; | 452 break; |
| 452 case AX_ATTR_POS_IN_SET: | 453 case AX_ATTR_POS_IN_SET: |
| 453 result += " posinset=" + value; | 454 result += " posinset=" + value; |
| 454 break; | 455 break; |
| 455 case AX_ATTR_INVALID_STATE: | 456 case AX_ATTR_INVALID_STATE: |
| 456 switch (int_attributes[i].second) { | 457 switch (int_attributes[i].second) { |
| 457 case AX_INVALID_STATE_FALSE: | 458 case AX_INVALID_STATE_FALSE: |
| 458 result += " invalid_state=false"; | 459 result += " invalid_state=false"; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 bool AXNodeData::IsRoot() const { | 641 bool AXNodeData::IsRoot() const { |
| 641 return (role == AX_ROLE_ROOT_WEB_AREA || | 642 return (role == AX_ROLE_ROOT_WEB_AREA || |
| 642 role == AX_ROLE_DESKTOP); | 643 role == AX_ROLE_DESKTOP); |
| 643 } | 644 } |
| 644 | 645 |
| 645 void AXNodeData::SetRoot() { | 646 void AXNodeData::SetRoot() { |
| 646 role = AX_ROLE_ROOT_WEB_AREA; | 647 role = AX_ROLE_ROOT_WEB_AREA; |
| 647 } | 648 } |
| 648 | 649 |
| 649 } // namespace ui | 650 } // namespace ui |
| OLD | NEW |