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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, GetRoot()); | 125 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, GetRoot()); |
126 BrowserAccessibilityManager::OnWindowFocused(); | 126 BrowserAccessibilityManager::OnWindowFocused(); |
127 } | 127 } |
128 | 128 |
129 void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent( | 129 void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent( |
130 ui::AXEvent event_type, | 130 ui::AXEvent event_type, |
131 BrowserAccessibility* node) { | 131 BrowserAccessibility* node) { |
132 if (!delegate_ || !delegate_->AccessibilityGetAcceleratedWidget()) | 132 if (!delegate_ || !delegate_->AccessibilityGetAcceleratedWidget()) |
133 return; | 133 return; |
134 | 134 |
| 135 // Don't fire events when this document is stale and the user has |
| 136 // started navigating to a new document. |
| 137 if (user_is_navigating_away_) |
| 138 return; |
| 139 |
135 // Inline text boxes are an internal implementation detail, we don't | 140 // Inline text boxes are an internal implementation detail, we don't |
136 // expose them to Windows. | 141 // expose them to Windows. |
137 if (node->GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX) | 142 if (node->GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX) |
138 return; | 143 return; |
139 | 144 |
140 // Don't fire focus, blur, or load complete notifications if the | 145 // Don't fire focus, blur, or load complete notifications if the |
141 // window isn't focused, because that can confuse screen readers into | 146 // window isn't focused, because that can confuse screen readers into |
142 // entering their "browse" mode. | 147 // entering their "browse" mode. |
143 if ((event_type == ui::AX_EVENT_FOCUS || | 148 if ((event_type == ui::AX_EVENT_FOCUS || |
144 event_type == ui::AX_EVENT_BLUR || | 149 event_type == ui::AX_EVENT_BLUR || |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 unique_id_to_ax_id_map_.find(unique_id_win); | 287 unique_id_to_ax_id_map_.find(unique_id_win); |
283 if (iter != unique_id_to_ax_id_map_.end()) { | 288 if (iter != unique_id_to_ax_id_map_.end()) { |
284 BrowserAccessibility* result = GetFromID(iter->second); | 289 BrowserAccessibility* result = GetFromID(iter->second); |
285 if (result) | 290 if (result) |
286 return result->ToBrowserAccessibilityWin(); | 291 return result->ToBrowserAccessibilityWin(); |
287 } | 292 } |
288 return NULL; | 293 return NULL; |
289 } | 294 } |
290 | 295 |
291 } // namespace content | 296 } // namespace content |
OLD | NEW |