Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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. | |
| 209 ::NotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, hwnd, OBJID_CARET, child_id); | |
|
dmazzoni
2017/04/17 05:07:34
I don't think we want this here, because this mean
| |
| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 DCHECK(changed_node); | 303 DCHECK(changed_node); |
| 300 BrowserAccessibility* obj = GetFromAXNode(changed_node); | 304 BrowserAccessibility* obj = GetFromAXNode(changed_node); |
| 301 if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) { | 305 if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) { |
| 302 ToBrowserAccessibilityWin(obj)->UpdateStep3FireEvents( | 306 ToBrowserAccessibilityWin(obj)->UpdateStep3FireEvents( |
| 303 changes[i].type == AXTreeDelegate::SUBTREE_CREATED); | 307 changes[i].type == AXTreeDelegate::SUBTREE_CREATED); |
| 304 } | 308 } |
| 305 } | 309 } |
| 306 } | 310 } |
| 307 | 311 |
| 308 } // namespace content | 312 } // namespace content |
| OLD | NEW |