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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 | 66 |
67 if (o.isSelected()) | 67 if (o.isSelected()) |
68 state |= (1 << ui::AX_STATE_SELECTED); | 68 state |= (1 << ui::AX_STATE_SELECTED); |
69 | 69 |
70 if (o.isVisited()) | 70 if (o.isVisited()) |
71 state |= (1 << ui::AX_STATE_VISITED); | 71 state |= (1 << ui::AX_STATE_VISITED); |
72 | 72 |
73 if (o.isEnabled()) | 73 if (o.isEnabled()) |
74 state |= (1 << ui::AX_STATE_ENABLED); | 74 state |= (1 << ui::AX_STATE_ENABLED); |
75 | 75 |
76 if (o.isVertical()) | 76 blink::WebAXOrientation orientation = o.orientation(); |
77 state |= (1 << ui::AX_STATE_VERTICAL); | 77 if (orientation) { |
dmazzoni
2014/11/29 07:48:19
Nit: I'd drop the if (orientation) check; it's not
| |
78 if (orientation == blink::WebAXOrientationVertical) | |
79 state |= (1 << ui::AX_STATE_VERTICAL); | |
80 else if (orientation == blink::WebAXOrientationHorizontal) | |
81 state |= (1 << ui::AX_STATE_HORIZONTAL); | |
82 } | |
78 | 83 |
79 if (o.isVisited()) | 84 if (o.isVisited()) |
80 state |= (1 << ui::AX_STATE_VISITED); | 85 state |= (1 << ui::AX_STATE_VISITED); |
81 | 86 |
82 return state; | 87 return state; |
83 } | 88 } |
84 | 89 |
85 ui::AXRole AXRoleFromBlink(blink::WebAXRole role) { | 90 ui::AXRole AXRoleFromBlink(blink::WebAXRole role) { |
86 switch (role) { | 91 switch (role) { |
87 case blink::WebAXRoleAlert: | 92 case blink::WebAXRoleAlert: |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 case blink::WebAXTextDirectionBT: | 397 case blink::WebAXTextDirectionBT: |
393 return ui::AX_TEXT_DIRECTION_BT; | 398 return ui::AX_TEXT_DIRECTION_BT; |
394 default: | 399 default: |
395 NOTREACHED(); | 400 NOTREACHED(); |
396 } | 401 } |
397 | 402 |
398 return ui::AX_TEXT_DIRECTION_NONE; | 403 return ui::AX_TEXT_DIRECTION_NONE; |
399 } | 404 } |
400 | 405 |
401 } // namespace content | 406 } // namespace content |
OLD | NEW |