network_feature_pod_button_legacy.h 1.7 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_NETWORK_NETWORK_FEATURE_POD_BUTTON_LEGACY_H_
  5. #define ASH_SYSTEM_NETWORK_NETWORK_FEATURE_POD_BUTTON_LEGACY_H_
  6. #include "ash/system/network/network_icon_animation_observer.h"
  7. #include "ash/system/network/tray_network_state_observer.h"
  8. #include "ash/system/unified/feature_pod_button.h"
  9. namespace ash {
  10. // Button view class for network feature pod button. It uses network_icon
  11. // animation to implement network connecting animation on feature pod button.
  12. class NetworkFeaturePodButtonLegacy : public FeaturePodButton,
  13. public network_icon::AnimationObserver,
  14. public TrayNetworkStateObserver {
  15. public:
  16. explicit NetworkFeaturePodButtonLegacy(FeaturePodControllerBase* controller);
  17. NetworkFeaturePodButtonLegacy(const NetworkFeaturePodButtonLegacy&) = delete;
  18. NetworkFeaturePodButtonLegacy& operator=(
  19. const NetworkFeaturePodButtonLegacy&) = delete;
  20. ~NetworkFeaturePodButtonLegacy() override;
  21. // Updates the button's icon and tooltip based on the current state of the
  22. // system.
  23. void Update();
  24. // network_icon::AnimationObserver:
  25. void NetworkIconChanged() override;
  26. // TrayNetworkStateObserver:
  27. void ActiveNetworkStateChanged() override;
  28. // views::Button:
  29. void OnThemeChanged() override;
  30. const char* GetClassName() const override;
  31. private:
  32. void UpdateTooltip(const std::u16string& connection_state_message);
  33. };
  34. } // namespace ash
  35. #endif // ASH_SYSTEM_NETWORK_NETWORK_FEATURE_POD_BUTTON_LEGACY_H_