ax_tree_update_mojom_traits.cc 819 B

12345678910111213141516171819202122232425
  1. // Copyright 2018 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. #include "ui/accessibility/mojom/ax_tree_update_mojom_traits.h"
  5. namespace mojo {
  6. // static
  7. bool StructTraits<ax::mojom::AXTreeUpdateDataView, ui::AXTreeUpdate>::Read(
  8. ax::mojom::AXTreeUpdateDataView data,
  9. ui::AXTreeUpdate* out) {
  10. out->has_tree_data = data.has_tree_data();
  11. if (!data.ReadTreeData(&out->tree_data))
  12. return false;
  13. out->node_id_to_clear = data.node_id_to_clear();
  14. out->root_id = data.root_id();
  15. if (!data.ReadNodes(&out->nodes))
  16. return false;
  17. out->event_from = data.event_from();
  18. out->event_from_action = data.event_from_action();
  19. return data.ReadEventIntents(&out->event_intents);
  20. }
  21. } // namespace mojo