event_dispatcher_mojom_traits.cc 976 B

1234567891011121314151617181920212223242526272829
  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. #include "extensions/common/mojom/event_dispatcher_mojom_traits.h"
  5. #include "url/mojom/url_gurl_mojom_traits.h"
  6. namespace mojo {
  7. bool StructTraits<extensions::mojom::EventFilteringInfoDataView,
  8. extensions::EventFilteringInfo>::
  9. Read(extensions::mojom::EventFilteringInfoDataView data,
  10. extensions::EventFilteringInfo* out) {
  11. *out = extensions::EventFilteringInfo();
  12. if (!data.ReadUrl(&out->url))
  13. return false;
  14. if (!data.ReadServiceType(&out->service_type))
  15. return false;
  16. if (data.has_instance_id())
  17. out->instance_id = data.instance_id();
  18. if (!data.ReadWindowType(&out->window_type))
  19. return false;
  20. if (data.has_window_exposed_by_default())
  21. out->window_exposed_by_default = data.window_exposed_by_default();
  22. return true;
  23. }
  24. } // namespace mojo