ax_event_intent_mojom_traits.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2020 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_MOJOM_AX_EVENT_INTENT_MOJOM_TRAITS_H_
  5. #define UI_ACCESSIBILITY_MOJOM_AX_EVENT_INTENT_MOJOM_TRAITS_H_
  6. #include "ui/accessibility/ax_event_intent.h"
  7. #include "ui/accessibility/mojom/ax_event_intent.mojom.h"
  8. namespace mojo {
  9. template <>
  10. struct StructTraits<ax::mojom::EventIntentDataView, ui::AXEventIntent> {
  11. static ax::mojom::Command command(const ui::AXEventIntent& p) {
  12. return p.command;
  13. }
  14. static ax::mojom::InputEventType input_event_type(
  15. const ui::AXEventIntent& p) {
  16. return p.input_event_type;
  17. }
  18. static ax::mojom::TextBoundary text_boundary(const ui::AXEventIntent& p) {
  19. return p.text_boundary;
  20. }
  21. static ax::mojom::MoveDirection move_direction(const ui::AXEventIntent& p) {
  22. return p.move_direction;
  23. }
  24. static bool Read(ax::mojom::EventIntentDataView data, ui::AXEventIntent* out);
  25. };
  26. } // namespace mojo
  27. #endif // UI_ACCESSIBILITY_MOJOM_AX_EVENT_INTENT_MOJOM_TRAITS_H_