ax_tree_source_observer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef UI_ACCESSIBILITY_AX_TREE_SOURCE_OBSERVER_H_
  5. #define UI_ACCESSIBILITY_AX_TREE_SOURCE_OBSERVER_H_
  6. #include "base/observer_list_types.h"
  7. #include "ui/accessibility/ax_export.h"
  8. namespace ui {
  9. template <typename AXNodeSource>
  10. class AXTreeSource;
  11. // This is an interface for a class that observes changes to an `AXTreeSource`.
  12. template <typename AXNodeSource>
  13. class AX_EXPORT AXTreeSourceObserver : public base::CheckedObserver {
  14. public:
  15. ~AXTreeSourceObserver() override = default;
  16. virtual void OnNodeAdded(const AXTreeSource<AXNodeSource>& tree_source,
  17. const AXNodeSource& node_source) = 0;
  18. virtual void OnNodeUpdated(const AXTreeSource<AXNodeSource>& tree_source,
  19. const AXNodeSource& node_source) = 0;
  20. virtual void OnNodeRemoved(const AXTreeSource<AXNodeSource>& tree_source,
  21. const AXNodeSource& node_source) = 0;
  22. };
  23. } // namespace ui
  24. #endif // UI_ACCESSIBILITY_AX_TREE_SOURCE_OBSERVER_H_