null_ax_action_target.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2019 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_NULL_AX_ACTION_TARGET_H_
  5. #define UI_ACCESSIBILITY_NULL_AX_ACTION_TARGET_H_
  6. #include "ui/accessibility/ax_action_target.h"
  7. #include "ui/accessibility/ax_export.h"
  8. namespace ui {
  9. // A do-nothing action target.
  10. class AX_EXPORT NullAXActionTarget : public AXActionTarget {
  11. public:
  12. NullAXActionTarget() = default;
  13. ~NullAXActionTarget() override = default;
  14. protected:
  15. // AXActionTarget overrides.
  16. Type GetType() const override;
  17. bool PerformAction(const AXActionData& action_data) const override;
  18. gfx::Rect GetRelativeBounds() const override;
  19. gfx::Point GetScrollOffset() const override;
  20. gfx::Point MinimumScrollOffset() const override;
  21. gfx::Point MaximumScrollOffset() const override;
  22. void SetScrollOffset(const gfx::Point& point) const override;
  23. bool SetSelected(bool selected) const override;
  24. bool SetSelection(const AXActionTarget* anchor_object,
  25. int anchor_offset,
  26. const AXActionTarget* focus_object,
  27. int focus_offset) const override;
  28. bool ScrollToMakeVisible() const override;
  29. bool ScrollToMakeVisibleWithSubFocus(
  30. const gfx::Rect& rect,
  31. ax::mojom::ScrollAlignment horizontal_scroll_alignment,
  32. ax::mojom::ScrollAlignment vertical_scroll_alignment,
  33. ax::mojom::ScrollBehavior scroll_behavior) const override;
  34. };
  35. } // namespace ui
  36. #endif // UI_ACCESSIBILITY_NULL_AX_ACTION_TARGET_H_