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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 tracked_scroll_object_ && | 255 tracked_scroll_object_ && |
256 tracked_scroll_object_->IsDescendantOf(node)) { | 256 tracked_scroll_object_->IsDescendantOf(node)) { |
257 MaybeCallNotifyWinEvent( | 257 MaybeCallNotifyWinEvent( |
258 IA2_EVENT_VISIBLE_DATA_CHANGED, | 258 IA2_EVENT_VISIBLE_DATA_CHANGED, |
259 tracked_scroll_object_->ToBrowserAccessibilityWin()->unique_id_win()); | 259 tracked_scroll_object_->ToBrowserAccessibilityWin()->unique_id_win()); |
260 tracked_scroll_object_->Release(); | 260 tracked_scroll_object_->Release(); |
261 tracked_scroll_object_ = NULL; | 261 tracked_scroll_object_ = NULL; |
262 } | 262 } |
263 } | 263 } |
264 | 264 |
265 void BrowserAccessibilityManagerWin::OnRootChanged(ui::AXNode* new_root) { | 265 void BrowserAccessibilityManagerWin::OnAtomicUpdateFinished( |
266 // In order to make screen readers aware of the new accessibility root, | 266 bool root_changed, |
267 // we need to fire a focus event on it. | 267 const std::vector<ui::AXTreeDelegate::Change>& changes) { |
268 OnWindowFocused(); | 268 if (root_changed) { |
| 269 // In order to make screen readers aware of the new accessibility root, |
| 270 // we need to fire a focus event on it. |
| 271 OnWindowFocused(); |
| 272 } |
269 } | 273 } |
270 | 274 |
271 void BrowserAccessibilityManagerWin::TrackScrollingObject( | 275 void BrowserAccessibilityManagerWin::TrackScrollingObject( |
272 BrowserAccessibilityWin* node) { | 276 BrowserAccessibilityWin* node) { |
273 if (tracked_scroll_object_) | 277 if (tracked_scroll_object_) |
274 tracked_scroll_object_->Release(); | 278 tracked_scroll_object_->Release(); |
275 tracked_scroll_object_ = node; | 279 tracked_scroll_object_ = node; |
276 tracked_scroll_object_->AddRef(); | 280 tracked_scroll_object_->AddRef(); |
277 } | 281 } |
278 | 282 |
279 BrowserAccessibilityWin* BrowserAccessibilityManagerWin::GetFromUniqueIdWin( | 283 BrowserAccessibilityWin* BrowserAccessibilityManagerWin::GetFromUniqueIdWin( |
280 LONG unique_id_win) { | 284 LONG unique_id_win) { |
281 base::hash_map<LONG, int32>::iterator iter = | 285 base::hash_map<LONG, int32>::iterator iter = |
282 unique_id_to_ax_id_map_.find(unique_id_win); | 286 unique_id_to_ax_id_map_.find(unique_id_win); |
283 if (iter != unique_id_to_ax_id_map_.end()) { | 287 if (iter != unique_id_to_ax_id_map_.end()) { |
284 BrowserAccessibility* result = GetFromID(iter->second); | 288 BrowserAccessibility* result = GetFromID(iter->second); |
285 if (result) | 289 if (result) |
286 return result->ToBrowserAccessibilityWin(); | 290 return result->ToBrowserAccessibilityWin(); |
287 } | 291 } |
288 return NULL; | 292 return NULL; |
289 } | 293 } |
290 | 294 |
291 } // namespace content | 295 } // namespace content |
OLD | NEW |