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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/win/scoped_comptr.h" | 8 #include "base/win/scoped_comptr.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 10 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void BrowserAccessibilityManagerWin::RemoveNode(BrowserAccessibility* node) { | 90 void BrowserAccessibilityManagerWin::RemoveNode(BrowserAccessibility* node) { |
91 unique_id_to_renderer_id_map_.erase( | 91 unique_id_to_renderer_id_map_.erase( |
92 node->ToBrowserAccessibilityWin()->unique_id_win()); | 92 node->ToBrowserAccessibilityWin()->unique_id_win()); |
93 BrowserAccessibilityManager::RemoveNode(node); | 93 BrowserAccessibilityManager::RemoveNode(node); |
94 if (node == tracked_scroll_object_) { | 94 if (node == tracked_scroll_object_) { |
95 tracked_scroll_object_->Release(); | 95 tracked_scroll_object_->Release(); |
96 tracked_scroll_object_ = NULL; | 96 tracked_scroll_object_ = NULL; |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
| 100 void BrowserAccessibilityManagerWin::OnWindowFocused() { |
| 101 // Fire a focus event on the root first and then the focused node. |
| 102 if (focus_ != root_) |
| 103 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, root_); |
| 104 BrowserAccessibilityManager::OnWindowFocused(); |
| 105 } |
| 106 |
| 107 void BrowserAccessibilityManagerWin::OnWindowBlurred() { |
| 108 // Fire a blur event on the focused node first and then the root. |
| 109 BrowserAccessibilityManager::OnWindowBlurred(); |
| 110 if (focus_ != root_) |
| 111 NotifyAccessibilityEvent(ui::AX_EVENT_BLUR, root_); |
| 112 } |
| 113 |
100 void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent( | 114 void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent( |
101 ui::AXEvent event_type, | 115 ui::AXEvent event_type, |
102 BrowserAccessibility* node) { | 116 BrowserAccessibility* node) { |
103 if (node->role() == ui::AX_ROLE_INLINE_TEXT_BOX) | 117 if (node->role() == ui::AX_ROLE_INLINE_TEXT_BOX) |
104 return; | 118 return; |
105 | 119 |
106 LONG event_id = EVENT_MIN; | 120 LONG event_id = EVENT_MIN; |
107 switch (event_type) { | 121 switch (event_type) { |
108 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: | 122 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: |
109 event_id = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED; | 123 event_id = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // |parent_iaccessible_| are no longer valid either, since they were | 247 // |parent_iaccessible_| are no longer valid either, since they were |
234 // derived from AccessibleHWND. We don't have to restore them to | 248 // derived from AccessibleHWND. We don't have to restore them to |
235 // previous values, though, because this should only happen | 249 // previous values, though, because this should only happen |
236 // during the destruct sequence for this window. | 250 // during the destruct sequence for this window. |
237 accessible_hwnd_ = NULL; | 251 accessible_hwnd_ = NULL; |
238 parent_hwnd_ = NULL; | 252 parent_hwnd_ = NULL; |
239 parent_iaccessible_ = NULL; | 253 parent_iaccessible_ = NULL; |
240 } | 254 } |
241 | 255 |
242 } // namespace content | 256 } // namespace content |
OLD | NEW |