logged_in_user_enabled_provider.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_FEATURE_STATUS_TRACKER_LOGGED_IN_USER_ENABLED_PROVIDER_H_
  5. #define ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_LOGGED_IN_USER_ENABLED_PROVIDER_H_
  6. #include "ash/public/cpp/session/session_controller.h"
  7. #include "ash/public/cpp/session/session_observer.h"
  8. #include "ash/quick_pair/feature_status_tracker/base_enabled_provider.h"
  9. #include "base/scoped_observation.h"
  10. namespace ash {
  11. namespace quick_pair {
  12. // Observes whether there is a logged in user.
  13. class LoggedInUserEnabledProvider : public BaseEnabledProvider,
  14. public SessionObserver {
  15. public:
  16. LoggedInUserEnabledProvider();
  17. ~LoggedInUserEnabledProvider() override;
  18. // SessionObserver:
  19. void OnLoginStatusChanged(LoginStatus login_status) override;
  20. private:
  21. base::ScopedObservation<SessionController, SessionObserver> observation_{
  22. this};
  23. };
  24. } // namespace quick_pair
  25. } // namespace ash
  26. #endif // ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_LOGGED_IN_USER_ENABLED_PROVIDER_H_