cast_feature_pod_controller.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2018 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_CAST_CAST_FEATURE_POD_CONTROLLER_H_
  5. #define ASH_SYSTEM_CAST_CAST_FEATURE_POD_CONTROLLER_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/public/cpp/cast_config_controller.h"
  8. #include "ash/system/unified/feature_pod_controller_base.h"
  9. namespace ash {
  10. class UnifiedSystemTrayController;
  11. // Controller of cast feature pod button.
  12. class ASH_EXPORT CastFeaturePodController
  13. : public FeaturePodControllerBase,
  14. public CastConfigController::Observer {
  15. public:
  16. explicit CastFeaturePodController(
  17. UnifiedSystemTrayController* tray_controller);
  18. CastFeaturePodController(const CastFeaturePodController&) = delete;
  19. CastFeaturePodController& operator=(const CastFeaturePodController&) = delete;
  20. ~CastFeaturePodController() override;
  21. // FeaturePodControllerBase:
  22. FeaturePodButton* CreateButton() override;
  23. void OnIconPressed() override;
  24. void OnLabelPressed() override;
  25. SystemTrayItemUmaType GetUmaType() const override;
  26. // CastConfigControllerObserver:
  27. void OnDevicesUpdated(const std::vector<SinkAndRoute>& devices) override;
  28. private:
  29. void Update();
  30. // Unowned.
  31. UnifiedSystemTrayController* const tray_controller_;
  32. FeaturePodButton* button_ = nullptr;
  33. };
  34. } // namespace ash
  35. #endif // ASH_SYSTEM_CAST_CAST_FEATURE_POD_CONTROLLER_H_