Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: ui/accessibility/platform/ax_platform_node_win.cc

Issue 2781613003: Added a class acting as a fake caret for accessibility. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (event_type == ui::AX_EVENT_SELECTION && 174 if (event_type == ui::AX_EVENT_SELECTION &&
175 GetData().role == ui::AX_ROLE_MENU_ITEM) 175 GetData().role == ui::AX_ROLE_MENU_ITEM)
176 event_type = ui::AX_EVENT_FOCUS; 176 event_type = ui::AX_EVENT_FOCUS;
177 177
178 int native_event = MSAAEvent(event_type); 178 int native_event = MSAAEvent(event_type);
179 if (native_event < EVENT_MIN) 179 if (native_event < EVENT_MIN)
180 return; 180 return;
181 181
182 ::NotifyWinEvent(native_event, hwnd, OBJID_CLIENT, -unique_id_); 182 ::NotifyWinEvent(native_event, hwnd, OBJID_CLIENT, -unique_id_);
183 183
184 if (event_type == ui::AX_EVENT_TEXT_SELECTION_CHANGED) {
185 // We also need to fire an older MSAA event used by some assistive software.
dougt 2017/03/28 15:23:44 Nit: comment is odd here since we're not dispatchi
186 ::NotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, hwnd, OBJID_CARET,
187 -unique_id_);
188 }
189
184 // Keep track of objects that are a target of an alert event. 190 // Keep track of objects that are a target of an alert event.
185 if (event_type == ui::AX_EVENT_ALERT) 191 if (event_type == ui::AX_EVENT_ALERT)
186 AddAlertTarget(); 192 AddAlertTarget();
187 } 193 }
188 194
189 int AXPlatformNodeWin::GetIndexInParent() { 195 int AXPlatformNodeWin::GetIndexInParent() {
190 base::win::ScopedComPtr<IDispatch> parent_dispatch; 196 base::win::ScopedComPtr<IDispatch> parent_dispatch;
191 base::win::ScopedComPtr<IAccessible> parent_accessible; 197 base::win::ScopedComPtr<IAccessible> parent_accessible;
192 if (S_OK != get_accParent(parent_dispatch.Receive())) 198 if (S_OK != get_accParent(parent_dispatch.Receive()))
193 return -1; 199 return -1;
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 ui::TextBoundaryDirection direction) { 1198 ui::TextBoundaryDirection direction) {
1193 HandleSpecialTextOffset(&start_offset); 1199 HandleSpecialTextOffset(&start_offset);
1194 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); 1200 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary);
1195 std::vector<int32_t> line_breaks; 1201 std::vector<int32_t> line_breaks;
1196 return static_cast<LONG>(ui::FindAccessibleTextBoundary( 1202 return static_cast<LONG>(ui::FindAccessibleTextBoundary(
1197 text, line_breaks, boundary, start_offset, direction, 1203 text, line_breaks, boundary, start_offset, direction,
1198 AX_TEXT_AFFINITY_DOWNSTREAM)); 1204 AX_TEXT_AFFINITY_DOWNSTREAM));
1199 } 1205 }
1200 1206
1201 } // namespace ui 1207 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698