nearby_share_controller_impl.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2020 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_SYSTEM_NEARBY_SHARE_NEARBY_SHARE_CONTROLLER_IMPL_H_
  5. #define ASH_SYSTEM_NEARBY_SHARE_NEARBY_SHARE_CONTROLLER_IMPL_H_
  6. #include "ash/public/cpp/nearby_share_controller.h"
  7. #include "base/observer_list.h"
  8. #include "base/observer_list_types.h"
  9. namespace ash {
  10. // Handles Nearby Share events from //chrome, providing an observer interface
  11. // within //ash. Singleton, lives on UI thread.
  12. class NearbyShareControllerImpl : public NearbyShareController {
  13. public:
  14. class Observer : public base::CheckedObserver {
  15. public:
  16. // Relays high visibility state changes from the service to the pod button.
  17. virtual void OnHighVisibilityEnabledChanged(bool enabled) = 0;
  18. };
  19. NearbyShareControllerImpl();
  20. NearbyShareControllerImpl(NearbyShareControllerImpl&) = delete;
  21. NearbyShareControllerImpl& operator=(NearbyShareControllerImpl&) = delete;
  22. ~NearbyShareControllerImpl() override;
  23. // NearbyShareController
  24. void HighVisibilityEnabledChanged(bool enabled) override;
  25. void AddObserver(Observer* obs);
  26. void RemoveObserver(Observer* obs);
  27. private:
  28. base::ObserverList<Observer> observers_;
  29. };
  30. } // namespace ash
  31. #endif // ASH_SYSTEM_NEARBY_SHARE_NEARBY_SHARE_CONTROLLER_IMPL_H_