OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 #include <oleacc.h> | 7 #include <oleacc.h> |
| 8 #include <stdint.h> |
8 | 9 |
9 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
10 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
11 #include "base/win/scoped_comptr.h" | 12 #include "base/win/scoped_comptr.h" |
12 #include "base/win/scoped_variant.h" | 13 #include "base/win/scoped_variant.h" |
13 #include "third_party/iaccessible2/ia2_api_all.h" | 14 #include "third_party/iaccessible2/ia2_api_all.h" |
14 #include "ui/accessibility/ax_node_data.h" | 15 #include "ui/accessibility/ax_node_data.h" |
15 #include "ui/accessibility/ax_text_utils.h" | 16 #include "ui/accessibility/ax_text_utils.h" |
16 #include "ui/accessibility/platform/ax_platform_node_delegate.h" | 17 #include "ui/accessibility/platform/ax_platform_node_delegate.h" |
17 #include "ui/accessibility/platform/ax_platform_node_win.h" | 18 #include "ui/accessibility/platform/ax_platform_node_win.h" |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 case ui::AX_ROLE_WINDOW: | 961 case ui::AX_ROLE_WINDOW: |
961 return ROLE_SYSTEM_WINDOW; | 962 return ROLE_SYSTEM_WINDOW; |
962 case ui::AX_ROLE_CLIENT: | 963 case ui::AX_ROLE_CLIENT: |
963 default: | 964 default: |
964 // This is the default role for MSAA. | 965 // This is the default role for MSAA. |
965 return ROLE_SYSTEM_CLIENT; | 966 return ROLE_SYSTEM_CLIENT; |
966 } | 967 } |
967 } | 968 } |
968 | 969 |
969 int AXPlatformNodeWin::MSAAState() { | 970 int AXPlatformNodeWin::MSAAState() { |
970 uint32 state = GetData().state; | 971 uint32_t state = GetData().state; |
971 | 972 |
972 int msaa_state = 0; | 973 int msaa_state = 0; |
973 if (state & (1 << ui::AX_STATE_CHECKED)) | 974 if (state & (1 << ui::AX_STATE_CHECKED)) |
974 msaa_state |= STATE_SYSTEM_CHECKED; | 975 msaa_state |= STATE_SYSTEM_CHECKED; |
975 if (state & (1 << ui::AX_STATE_COLLAPSED)) | 976 if (state & (1 << ui::AX_STATE_COLLAPSED)) |
976 msaa_state |= STATE_SYSTEM_COLLAPSED; | 977 msaa_state |= STATE_SYSTEM_COLLAPSED; |
977 if (state & (1 << ui::AX_STATE_DEFAULT)) | 978 if (state & (1 << ui::AX_STATE_DEFAULT)) |
978 msaa_state |= STATE_SYSTEM_DEFAULT; | 979 msaa_state |= STATE_SYSTEM_DEFAULT; |
979 if (state & (1 << ui::AX_STATE_EXPANDED)) | 980 if (state & (1 << ui::AX_STATE_EXPANDED)) |
980 msaa_state |= STATE_SYSTEM_EXPANDED; | 981 msaa_state |= STATE_SYSTEM_EXPANDED; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 } | 1097 } |
1097 } | 1098 } |
1098 | 1099 |
1099 LONG AXPlatformNodeWin::FindBoundary( | 1100 LONG AXPlatformNodeWin::FindBoundary( |
1100 const base::string16& text, | 1101 const base::string16& text, |
1101 IA2TextBoundaryType ia2_boundary, | 1102 IA2TextBoundaryType ia2_boundary, |
1102 LONG start_offset, | 1103 LONG start_offset, |
1103 ui::TextBoundaryDirection direction) { | 1104 ui::TextBoundaryDirection direction) { |
1104 HandleSpecialTextOffset(text, &start_offset); | 1105 HandleSpecialTextOffset(text, &start_offset); |
1105 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); | 1106 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); |
1106 std::vector<int32> line_breaks; | 1107 std::vector<int32_t> line_breaks; |
1107 return static_cast<LONG>(ui::FindAccessibleTextBoundary( | 1108 return static_cast<LONG>(ui::FindAccessibleTextBoundary( |
1108 text, line_breaks, boundary, start_offset, direction)); | 1109 text, line_breaks, boundary, start_offset, direction)); |
1109 } | 1110 } |
1110 | 1111 |
1111 } // namespace ui | 1112 } // namespace ui |
OLD | NEW |