quick_pair_keyed_service.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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. #ifndef ASH_QUICK_PAIR_KEYED_SERVICE_QUICK_PAIR_KEYED_SERVICE_H_
  5. #define ASH_QUICK_PAIR_KEYED_SERVICE_QUICK_PAIR_KEYED_SERVICE_H_
  6. #include <memory>
  7. #include "ash/quick_pair/keyed_service/quick_pair_mediator.h"
  8. #include "components/keyed_service/core/keyed_service.h"
  9. namespace ash {
  10. namespace quick_pair {
  11. // This class is intentionally 'thin' (i.e. holds references to other classes)
  12. // to decouple the logic from the KeyedService base class and ease testing.
  13. class QuickPairKeyedService : public KeyedService {
  14. explicit QuickPairKeyedService(std::unique_ptr<Mediator> mediator);
  15. QuickPairKeyedService(const QuickPairKeyedService&) = delete;
  16. QuickPairKeyedService& operator=(const QuickPairKeyedService&) = delete;
  17. ~QuickPairKeyedService() override;
  18. private:
  19. // KeyedService:
  20. void Shutdown() override;
  21. std::unique_ptr<Mediator> mediator_;
  22. };
  23. } // namespace quick_pair
  24. } // namespace ash
  25. #endif // ASH_QUICK_PAIR_KEYED_SERVICE_QUICK_PAIR_KEYED_SERVICE_H_