quick_pair_feature_status_tracker.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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_FEATURE_STATUS_TRACKER_QUICK_PAIR_FEATURE_STATUS_TRACKER_H_
  5. #define ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_QUICK_PAIR_FEATURE_STATUS_TRACKER_H_
  6. #include "ash/quick_pair/feature_status_tracker/fast_pair_enabled_provider.h"
  7. #include "base/memory/weak_ptr.h"
  8. #include "base/observer_list.h"
  9. #include "base/observer_list_types.h"
  10. namespace ash {
  11. namespace quick_pair {
  12. // Exposes APIs to query and track the status of the various
  13. // Quick Pair implementations (e.g. Fast Pair).
  14. class FeatureStatusTracker {
  15. public:
  16. class Observer : public base::CheckedObserver {
  17. public:
  18. virtual void OnFastPairEnabledChanged(bool is_enabled) = 0;
  19. };
  20. virtual ~FeatureStatusTracker() = default;
  21. virtual void AddObserver(Observer* observer) = 0;
  22. virtual void RemoveObserver(Observer* observer) = 0;
  23. virtual bool IsFastPairEnabled() = 0;
  24. };
  25. } // namespace quick_pair
  26. } // namespace ash
  27. #endif // ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_QUICK_PAIR_FEATURE_STATUS_TRACKER_H_