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

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

Issue 2917363002: Automatically fire AX events on Mac based on tree changes (Closed)
Patch Set: Fix accidental shadowing of BrowserAccessibilityManager::OnAtomicUpdateFinished, caught by browser … Created 3 years, 6 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 <memory> 10 #include <memory>
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 int end_offset); 336 int end_offset);
337 337
338 // Accessors. 338 // Accessors.
339 ui::AXTreeIDRegistry::AXTreeID ax_tree_id() const { return ax_tree_id_; } 339 ui::AXTreeIDRegistry::AXTreeID ax_tree_id() const { return ax_tree_id_; }
340 float device_scale_factor() const { return device_scale_factor_; } 340 float device_scale_factor() const { return device_scale_factor_; }
341 341
342 // AXTreeDelegate implementation. 342 // AXTreeDelegate implementation.
343 void OnNodeDataWillChange(ui::AXTree* tree, 343 void OnNodeDataWillChange(ui::AXTree* tree,
344 const ui::AXNodeData& old_node_data, 344 const ui::AXNodeData& old_node_data,
345 const ui::AXNodeData& new_node_data) override; 345 const ui::AXNodeData& new_node_data) override;
346 void OnTreeDataChanged(ui::AXTree* tree) override; 346 void OnTreeDataChanged(ui::AXTree* tree,
347 const ui::AXTreeData& old_tree_data,
348 const ui::AXTreeData& new_tree_data) override;
347 void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; 349 void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override;
348 void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; 350 void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override;
349 void OnNodeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override; 351 void OnNodeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override;
350 void OnSubtreeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override; 352 void OnSubtreeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override;
351 void OnNodeCreated(ui::AXTree* tree, ui::AXNode* node) override; 353 void OnNodeCreated(ui::AXTree* tree, ui::AXNode* node) override;
352 void OnNodeReparented(ui::AXTree* tree, ui::AXNode* node) override; 354 void OnNodeReparented(ui::AXTree* tree, ui::AXNode* node) override;
353 void OnNodeChanged(ui::AXTree* tree, ui::AXNode* node) override; 355 void OnNodeChanged(ui::AXTree* tree, ui::AXNode* node) override;
354 void OnAtomicUpdateFinished( 356 void OnAtomicUpdateFinished(
355 ui::AXTree* tree, 357 ui::AXTree* tree,
356 bool root_changed, 358 bool root_changed,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 438
437 // Factory to create BrowserAccessibility objects (for dependency injection). 439 // Factory to create BrowserAccessibility objects (for dependency injection).
438 std::unique_ptr<BrowserAccessibilityFactory> factory_; 440 std::unique_ptr<BrowserAccessibilityFactory> factory_;
439 441
440 // The underlying tree of accessibility objects. 442 // The underlying tree of accessibility objects.
441 std::unique_ptr<ui::AXSerializableTree> tree_; 443 std::unique_ptr<ui::AXSerializableTree> tree_;
442 444
443 // A mapping from a node id to its wrapper of type BrowserAccessibility. 445 // A mapping from a node id to its wrapper of type BrowserAccessibility.
444 base::hash_map<int32_t, BrowserAccessibility*> id_wrapper_map_; 446 base::hash_map<int32_t, BrowserAccessibility*> id_wrapper_map_;
445 447
446 // A queue of accessibility events to fire based on changes to the 448 // A set of accessibility events to fire based on changes to the
447 // accessibility tree. Each one is an event and a node id. 449 // accessibility tree. It's represented as a map from node id
448 std::vector<std::pair<ui::AXEvent, int32_t>> tree_events_; 450 // to a set of events, which makes it easy to remove duplicates.
451 std::map<int32_t, std::set<ui::AXEvent>> tree_events_;
449 452
450 // True if the user has initiated a navigation to another page. 453 // True if the user has initiated a navigation to another page.
451 bool user_is_navigating_away_; 454 bool user_is_navigating_away_;
452 455
453 // The on-screen keyboard state. 456 // The on-screen keyboard state.
454 OnScreenKeyboardState osk_state_; 457 OnScreenKeyboardState osk_state_;
455 458
456 BrowserAccessibilityFindInPageInfo find_in_page_info_; 459 BrowserAccessibilityFindInPageInfo find_in_page_info_;
457 460
458 // These are only used by the root BrowserAccessibilityManager of a 461 // These are only used by the root BrowserAccessibilityManager of a
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 // flakiness. See NeverSuppressOrDelayEventsForTesting() for details. 501 // flakiness. See NeverSuppressOrDelayEventsForTesting() for details.
499 static bool never_suppress_or_delay_events_for_testing_; 502 static bool never_suppress_or_delay_events_for_testing_;
500 503
501 private: 504 private:
502 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); 505 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager);
503 }; 506 };
504 507
505 } // namespace content 508 } // namespace content
506 509
507 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ 510 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698