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.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 ancestor = ancestor->GetParent(); | 445 ancestor = ancestor->GetParent(); |
446 } | 446 } |
447 | 447 |
448 // The "scrolled to anchor" notification is a great way to get a | 448 // The "scrolled to anchor" notification is a great way to get a |
449 // screen reader to jump directly to a specific location in a document. | 449 // screen reader to jump directly to a specific location in a document. |
450 NotifyAccessibilityEvent(ui::AX_EVENT_SCROLLED_TO_ANCHOR, node); | 450 NotifyAccessibilityEvent(ui::AX_EVENT_SCROLLED_TO_ANCHOR, node); |
451 } | 451 } |
452 | 452 |
453 BrowserAccessibility* BrowserAccessibilityManager::GetActiveDescendantFocus( | 453 BrowserAccessibility* BrowserAccessibilityManager::GetActiveDescendantFocus( |
454 BrowserAccessibility* focus) { | 454 BrowserAccessibility* focus) { |
455 if (!focus) | 455 if (!focus || !focus->instance_active()) |
dmazzoni
2016/04/18 18:27:03
We shouldn't ever have to check instance_active()
| |
456 return NULL; | 456 return nullptr; |
457 | 457 |
458 int active_descendant_id; | 458 int32_t active_descendant_id; |
459 if (focus->GetIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, | 459 if (focus->GetIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, |
460 &active_descendant_id)) { | 460 &active_descendant_id)) { |
461 BrowserAccessibility* active_descendant = | 461 BrowserAccessibility* active_descendant = |
462 focus->manager()->GetFromID(active_descendant_id); | 462 focus->manager()->GetFromID(active_descendant_id); |
463 if (active_descendant) | 463 if (active_descendant) |
464 return active_descendant; | 464 return active_descendant; |
465 } | 465 } |
466 return focus; | 466 return focus; |
467 } | 467 } |
468 | 468 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
849 tree_source(tree_->CreateTreeSource()); | 849 tree_source(tree_->CreateTreeSource()); |
850 ui::AXTreeSerializer<const ui::AXNode*, | 850 ui::AXTreeSerializer<const ui::AXNode*, |
851 ui::AXNodeData, | 851 ui::AXNodeData, |
852 ui::AXTreeData> serializer(tree_source.get()); | 852 ui::AXTreeData> serializer(tree_source.get()); |
853 ui::AXTreeUpdate update; | 853 ui::AXTreeUpdate update; |
854 serializer.SerializeChanges(tree_->root(), &update); | 854 serializer.SerializeChanges(tree_->root(), &update); |
855 return update; | 855 return update; |
856 } | 856 } |
857 | 857 |
858 } // namespace content | 858 } // namespace content |
OLD | NEW |