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

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

Issue 1761633002: One accessibility tree per frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix is-richly-editable test Created 4 years, 9 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
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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 ~BrowserAccessibilityManager() override; 132 ~BrowserAccessibilityManager() override;
133 133
134 void Initialize(const ui::AXTreeUpdate& initial_tree); 134 void Initialize(const ui::AXTreeUpdate& initial_tree);
135 135
136 static ui::AXTreeUpdate GetEmptyDocument(); 136 static ui::AXTreeUpdate GetEmptyDocument();
137 137
138 virtual void NotifyAccessibilityEvent( 138 virtual void NotifyAccessibilityEvent(
139 ui::AXEvent event_type, BrowserAccessibility* node) { } 139 ui::AXEvent event_type, BrowserAccessibility* node) { }
140 140
141 // Checks whether focus has changed since the last time it was checked,
142 // taking into account whether the window has focus and which frame within
143 // the frame tree has focus. If focus has changed, calls FireFocusEvent.
144 void FireFocusEventsIfNeeded();
145
146 // Return whether or not we are currently able to fire events.
147 virtual bool CanFireEvents();
148
149 // Fire a focus event. Virtual so that some platforms can customize it,
150 // like firing a focus event on the root first, on Windows.
151 virtual void FireFocusEvent(BrowserAccessibility* node);
152
141 // Return a pointer to the root of the tree, does not make a new reference. 153 // Return a pointer to the root of the tree, does not make a new reference.
142 BrowserAccessibility* GetRoot(); 154 BrowserAccessibility* GetRoot();
143 155
144 // Returns a pointer to the BrowserAccessibility object for a given AXNode. 156 // Returns a pointer to the BrowserAccessibility object for a given AXNode.
145 BrowserAccessibility* GetFromAXNode(const ui::AXNode* node) const; 157 BrowserAccessibility* GetFromAXNode(const ui::AXNode* node) const;
146 158
147 // Return a pointer to the object corresponding to the given id, 159 // Return a pointer to the object corresponding to the given id,
148 // does not make a new reference. 160 // does not make a new reference.
149 BrowserAccessibility* GetFromID(int32_t id) const; 161 BrowserAccessibility* GetFromID(int32_t id) const;
150 162
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 base::hash_map<int32_t, BrowserAccessibility*> id_wrapper_map_; 384 base::hash_map<int32_t, BrowserAccessibility*> id_wrapper_map_;
373 385
374 // True if the user has initiated a navigation to another page. 386 // True if the user has initiated a navigation to another page.
375 bool user_is_navigating_away_; 387 bool user_is_navigating_away_;
376 388
377 // The on-screen keyboard state. 389 // The on-screen keyboard state.
378 OnScreenKeyboardState osk_state_; 390 OnScreenKeyboardState osk_state_;
379 391
380 BrowserAccessibilityFindInPageInfo find_in_page_info_; 392 BrowserAccessibilityFindInPageInfo find_in_page_info_;
381 393
394 // These are only used by the root BrowserAccessibilityManager of a
395 // frame tree. Stores the last focused node and last focused manager so
396 // that when focus might have changed we can figure out whether we need
397 // to fire a focus event.
398 //
399 // NOTE: these pointers are not cleared, so they should never be
400 // dereferenced, only used for comparison.
401 BrowserAccessibility* last_focused_node_;
402 BrowserAccessibilityManager* last_focused_manager_;
403
382 // The global ID of this accessibility tree. 404 // The global ID of this accessibility tree.
383 AXTreeIDRegistry::AXTreeID ax_tree_id_; 405 AXTreeIDRegistry::AXTreeID ax_tree_id_;
384 406
385 // If this tree has a parent tree, this is the cached ID of the parent 407 // If this tree has a parent tree, this is the cached ID of the parent
386 // node within that parent tree. It's computed as needed and cached for 408 // node within that parent tree. It's computed as needed and cached for
387 // speed so that it can be accessed quickly if it hasn't changed. 409 // speed so that it can be accessed quickly if it hasn't changed.
388 int parent_node_id_from_parent_tree_; 410 int parent_node_id_from_parent_tree_;
389 411
390 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); 412 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager);
391 }; 413 };
392 414
393 } // namespace content 415 } // namespace content
394 416
395 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ 417 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698