quick_pair_service.cc 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. #include "ash/services/quick_pair/quick_pair_service.h"
  5. #include <memory>
  6. #include "ash/services/quick_pair/fast_pair_data_parser.h"
  7. #include "ash/services/quick_pair/public/mojom/fast_pair_data_parser.mojom-forward.h"
  8. #include "ash/services/quick_pair/public/mojom/quick_pair_service.mojom.h"
  9. #include "mojo/public/cpp/bindings/pending_receiver.h"
  10. #include "mojo/public/cpp/bindings/receiver.h"
  11. namespace ash {
  12. namespace quick_pair {
  13. QuickPairService::QuickPairService(
  14. mojo::PendingReceiver<mojom::QuickPairService> receiver)
  15. : receiver_(this, std::move(receiver)) {}
  16. QuickPairService::~QuickPairService() = default;
  17. void QuickPairService::Connect(
  18. mojo::PendingReceiver<mojom::FastPairDataParser> fast_pair_data_parser) {
  19. DCHECK(!fast_pair_data_parser_);
  20. fast_pair_data_parser_ =
  21. std::make_unique<FastPairDataParser>(std::move(fast_pair_data_parser));
  22. }
  23. } // namespace quick_pair
  24. } // namespace ash