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 <limits.h> | 7 #include <limits.h> |
8 #include <oleacc.h> | 8 #include <oleacc.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 } | 131 } |
132 | 132 |
133 // | 133 // |
134 // AXPlatformNodeWin | 134 // AXPlatformNodeWin |
135 // | 135 // |
136 | 136 |
137 AXPlatformNodeWin::AXPlatformNodeWin() { | 137 AXPlatformNodeWin::AXPlatformNodeWin() { |
138 } | 138 } |
139 | 139 |
140 AXPlatformNodeWin::~AXPlatformNodeWin() { | 140 AXPlatformNodeWin::~AXPlatformNodeWin() { |
141 CHECK(!delegate_); | 141 } |
| 142 |
| 143 // |
| 144 // AXPlatformNodeBase implementation. |
| 145 // |
| 146 |
| 147 void AXPlatformNodeWin::Dispose() { |
| 148 Release(); |
| 149 } |
| 150 |
| 151 void AXPlatformNodeWin::Destroy() { |
| 152 RemoveAlertTarget(); |
| 153 AXPlatformNodeBase::Destroy(); |
142 } | 154 } |
143 | 155 |
144 // | 156 // |
145 // AXPlatformNode implementation. | 157 // AXPlatformNode implementation. |
146 // | 158 // |
147 | 159 |
148 void AXPlatformNodeWin::Destroy() { | |
149 AXPlatformNode::Destroy(); | |
150 // Do not call base class AXPlatformNodeBase::Destroy method because it | |
151 // would delete this object. Call base's base class AXPlatformNode::Destroy | |
152 // instead to remove the unique ID from the map like base class does. | |
153 delegate_ = nullptr; | |
154 RemoveAlertTarget(); | |
155 Release(); | |
156 } | |
157 | |
158 gfx::NativeViewAccessible AXPlatformNodeWin::GetNativeViewAccessible() { | 160 gfx::NativeViewAccessible AXPlatformNodeWin::GetNativeViewAccessible() { |
159 return this; | 161 return this; |
160 } | 162 } |
161 | 163 |
162 void AXPlatformNodeWin::NotifyAccessibilityEvent(ui::AXEvent event_type) { | 164 void AXPlatformNodeWin::NotifyAccessibilityEvent(ui::AXEvent event_type) { |
163 HWND hwnd = delegate_->GetTargetForNativeAccessibilityEvent(); | 165 HWND hwnd = delegate_->GetTargetForNativeAccessibilityEvent(); |
164 if (!hwnd) | 166 if (!hwnd) |
165 return; | 167 return; |
166 | 168 |
167 // Menu items fire selection events but Windows screen readers work reliably | 169 // Menu items fire selection events but Windows screen readers work reliably |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 LONG start_offset, | 1142 LONG start_offset, |
1141 ui::TextBoundaryDirection direction) { | 1143 ui::TextBoundaryDirection direction) { |
1142 HandleSpecialTextOffset(text, &start_offset); | 1144 HandleSpecialTextOffset(text, &start_offset); |
1143 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); | 1145 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); |
1144 std::vector<int32_t> line_breaks; | 1146 std::vector<int32_t> line_breaks; |
1145 return static_cast<LONG>(ui::FindAccessibleTextBoundary( | 1147 return static_cast<LONG>(ui::FindAccessibleTextBoundary( |
1146 text, line_breaks, boundary, start_offset, direction)); | 1148 text, line_breaks, boundary, start_offset, direction)); |
1147 } | 1149 } |
1148 | 1150 |
1149 } // namespace ui | 1151 } // namespace ui |
OLD | NEW |