vpn_feature_pod_controller.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_NETWORK_VPN_FEATURE_POD_CONTROLLER_H_
  5. #define ASH_SYSTEM_NETWORK_VPN_FEATURE_POD_CONTROLLER_H_
  6. #include "ash/system/network/tray_network_state_observer.h"
  7. #include "ash/system/unified/feature_pod_controller_base.h"
  8. namespace ash {
  9. class UnifiedSystemTrayController;
  10. // Controller of vpn feature pod button.
  11. class VPNFeaturePodController : public FeaturePodControllerBase,
  12. public TrayNetworkStateObserver {
  13. public:
  14. explicit VPNFeaturePodController(
  15. UnifiedSystemTrayController* tray_controller);
  16. VPNFeaturePodController(const VPNFeaturePodController&) = delete;
  17. VPNFeaturePodController& operator=(const VPNFeaturePodController&) = delete;
  18. ~VPNFeaturePodController() override;
  19. // FeaturePodControllerBase:
  20. FeaturePodButton* CreateButton() override;
  21. void OnIconPressed() override;
  22. SystemTrayItemUmaType GetUmaType() const override;
  23. // TrayNetworkStateObserver:
  24. void ActiveNetworkStateChanged() override;
  25. private:
  26. void Update();
  27. // Unowned.
  28. UnifiedSystemTrayController* const tray_controller_;
  29. FeaturePodButton* button_ = nullptr;
  30. };
  31. } // namespace ash
  32. #endif // ASH_SYSTEM_NETWORK_VPN_FEATURE_POD_CONTROLLER_H_