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

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager_win.cc

Issue 2781613003: Added a class acting as a fake caret for accessibility. (Closed)
Patch Set: Created 3 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/accessibility/browser_accessibility_manager_win.h" 5 #include "content/browser/accessibility/browser_accessibility_manager_win.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (win_event_type == EVENT_OBJECT_REORDER && 197 if (win_event_type == EVENT_OBJECT_REORDER &&
198 target->PlatformChildCount() == 0) { 198 target->PlatformChildCount() == 0) {
199 return BrowserAccessibilityEvent::NotNeededOnThisPlatform; 199 return BrowserAccessibilityEvent::NotNeededOnThisPlatform;
200 } 200 }
201 201
202 // Pass the negation of this node's unique id in the |child_id| 202 // Pass the negation of this node's unique id in the |child_id|
203 // argument to NotifyWinEvent; the AT client will then call get_accChild 203 // argument to NotifyWinEvent; the AT client will then call get_accChild
204 // on the HWND's accessibility object and pass it that same id, which 204 // on the HWND's accessibility object and pass it that same id, which
205 // we can use to retrieve the IAccessible for this node. 205 // we can use to retrieve the IAccessible for this node.
206 LONG child_id = -target->unique_id(); 206 LONG child_id = -target->unique_id();
207 if (event_type == ui::AX_EVENT_DOCUMENT_SELECTION_CHANGED) {
208 // We also need to fire an older MSAA event used by some assistive software.
dougt 2017/03/28 15:23:44 This change seems unrelated to the fake caret. N
dmazzoni 2017/03/28 15:41:20 This is definitely related to the fake caret, sinc
209 ::NotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, hwnd, OBJID_CARET, child_id);
210 }
211
207 ::NotifyWinEvent(win_event_type, hwnd, OBJID_CLIENT, child_id); 212 ::NotifyWinEvent(win_event_type, hwnd, OBJID_CLIENT, child_id);
208
209 return BrowserAccessibilityEvent::Sent; 213 return BrowserAccessibilityEvent::Sent;
210 } 214 }
211 215
212 bool BrowserAccessibilityManagerWin::CanFireEvents() { 216 bool BrowserAccessibilityManagerWin::CanFireEvents() {
213 BrowserAccessibilityDelegate* root_delegate = GetDelegateFromRootManager(); 217 BrowserAccessibilityDelegate* root_delegate = GetDelegateFromRootManager();
214 if (!root_delegate) 218 if (!root_delegate)
215 return false; 219 return false;
216 HWND hwnd = root_delegate->AccessibilityGetAcceleratedWidget(); 220 HWND hwnd = root_delegate->AccessibilityGetAcceleratedWidget();
217 return hwnd != nullptr; 221 return hwnd != nullptr;
218 } 222 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 DCHECK(changed_node); 291 DCHECK(changed_node);
288 BrowserAccessibility* obj = GetFromAXNode(changed_node); 292 BrowserAccessibility* obj = GetFromAXNode(changed_node);
289 if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) { 293 if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) {
290 ToBrowserAccessibilityWin(obj)->UpdateStep3FireEvents( 294 ToBrowserAccessibilityWin(obj)->UpdateStep3FireEvents(
291 changes[i].type == AXTreeDelegate::SUBTREE_CREATED); 295 changes[i].type == AXTreeDelegate::SUBTREE_CREATED);
292 } 296 }
293 } 297 }
294 } 298 }
295 299
296 } // namespace content 300 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698