| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Don't fire events when this document might be stale as the user has | 148 // Don't fire events when this document might be stale as the user has |
| 149 // started navigating to a new document. | 149 // started navigating to a new document. |
| 150 if (user_is_navigating_away_) | 150 if (user_is_navigating_away_) |
| 151 return; | 151 return; |
| 152 | 152 |
| 153 // Inline text boxes are an internal implementation detail, we don't | 153 // Inline text boxes are an internal implementation detail, we don't |
| 154 // expose them to Windows. | 154 // expose them to Windows. |
| 155 if (node->GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX) | 155 if (node->GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX) |
| 156 return; | 156 return; |
| 157 | 157 |
| 158 // Don't fire focus, blur, or load complete notifications if the | |
| 159 // window isn't focused, because that can confuse screen readers into | |
| 160 // entering their "browse" mode. | |
| 161 if ((event_type == ui::AX_EVENT_FOCUS || | |
| 162 event_type == ui::AX_EVENT_BLUR || | |
| 163 event_type == ui::AX_EVENT_LOAD_COMPLETE) && | |
| 164 !NativeViewHasFocus()) { | |
| 165 return; | |
| 166 } | |
| 167 | |
| 168 LONG event_id = EVENT_MIN; | 158 LONG event_id = EVENT_MIN; |
| 169 switch (event_type) { | 159 switch (event_type) { |
| 170 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: | 160 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: |
| 171 event_id = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED; | 161 event_id = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED; |
| 172 break; | 162 break; |
| 173 case ui::AX_EVENT_ALERT: | 163 case ui::AX_EVENT_ALERT: |
| 174 event_id = EVENT_SYSTEM_ALERT; | 164 event_id = EVENT_SYSTEM_ALERT; |
| 175 break; | 165 break; |
| 176 case ui::AX_EVENT_AUTOCORRECTION_OCCURED: | 166 case ui::AX_EVENT_AUTOCORRECTION_OCCURED: |
| 177 event_id = IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED; | 167 event_id = IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 326 |
| 337 void BrowserAccessibilityManagerWin::TrackScrollingObject( | 327 void BrowserAccessibilityManagerWin::TrackScrollingObject( |
| 338 BrowserAccessibilityWin* node) { | 328 BrowserAccessibilityWin* node) { |
| 339 if (tracked_scroll_object_) | 329 if (tracked_scroll_object_) |
| 340 tracked_scroll_object_->Release(); | 330 tracked_scroll_object_->Release(); |
| 341 tracked_scroll_object_ = node; | 331 tracked_scroll_object_ = node; |
| 342 tracked_scroll_object_->AddRef(); | 332 tracked_scroll_object_->AddRef(); |
| 343 } | 333 } |
| 344 | 334 |
| 345 } // namespace content | 335 } // namespace content |
| OLD | NEW |