Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 1892593003: Prevent child frames from sending bad accessibility events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility_manager_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 BrowserAccessibility* parent = GetParentNodeFromParentTree(); 817 BrowserAccessibility* parent = GetParentNodeFromParentTree();
818 if (parent) { 818 if (parent) {
819 parent->OnDataChanged(); 819 parent->OnDataChanged();
820 parent->manager()->NotifyAccessibilityEvent( 820 parent->manager()->NotifyAccessibilityEvent(
821 ui::AX_EVENT_CHILDREN_CHANGED, parent); 821 ui::AX_EVENT_CHILDREN_CHANGED, parent);
822 } 822 }
823 } 823 }
824 } 824 }
825 825
826 BrowserAccessibilityManager* BrowserAccessibilityManager::GetRootManager() { 826 BrowserAccessibilityManager* BrowserAccessibilityManager::GetRootManager() {
827 if (!GetRoot()) 827 BrowserAccessibility* parent = GetParentNodeFromParentTree();
828 return nullptr; 828 if (!parent)
829 int parent_tree_id = GetTreeData().parent_tree_id; 829 return this;
830 BrowserAccessibilityManager* parent_manager = 830
831 BrowserAccessibilityManager::FromID(parent_tree_id); 831 return parent->manager()->GetRootManager();
832 if (parent_manager)
833 return parent_manager->GetRootManager();
834 return this;
835 } 832 }
836 833
837 BrowserAccessibilityDelegate* 834 BrowserAccessibilityDelegate*
838 BrowserAccessibilityManager::GetDelegateFromRootManager() { 835 BrowserAccessibilityManager::GetDelegateFromRootManager() {
839 BrowserAccessibilityManager* root_manager = GetRootManager(); 836 BrowserAccessibilityManager* root_manager = GetRootManager();
840 if (root_manager) 837 if (root_manager)
841 return root_manager->delegate(); 838 return root_manager->delegate();
842 return nullptr; 839 return nullptr;
843 } 840 }
844 841
845 ui::AXTreeUpdate 842 ui::AXTreeUpdate
846 BrowserAccessibilityManager::SnapshotAXTreeForTesting() { 843 BrowserAccessibilityManager::SnapshotAXTreeForTesting() {
847 std::unique_ptr< 844 std::unique_ptr<
848 ui::AXTreeSource<const ui::AXNode*, ui::AXNodeData, ui::AXTreeData>> 845 ui::AXTreeSource<const ui::AXNode*, ui::AXNodeData, ui::AXTreeData>>
849 tree_source(tree_->CreateTreeSource()); 846 tree_source(tree_->CreateTreeSource());
850 ui::AXTreeSerializer<const ui::AXNode*, 847 ui::AXTreeSerializer<const ui::AXNode*,
851 ui::AXNodeData, 848 ui::AXNodeData,
852 ui::AXTreeData> serializer(tree_source.get()); 849 ui::AXTreeData> serializer(tree_source.get());
853 ui::AXTreeUpdate update; 850 ui::AXTreeUpdate update;
854 serializer.SerializeChanges(tree_->root(), &update); 851 serializer.SerializeChanges(tree_->root(), &update);
855 return update; 852 return update;
856 } 853 }
857 854
858 } // namespace content 855 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698