rotation_lock_feature_pod_controller.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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_ROTATION_ROTATION_LOCK_FEATURE_POD_CONTROLLER_H_
  5. #define ASH_SYSTEM_ROTATION_ROTATION_LOCK_FEATURE_POD_CONTROLLER_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/display/screen_orientation_controller.h"
  8. #include "ash/public/cpp/tablet_mode_observer.h"
  9. #include "ash/system/unified/feature_pod_controller_base.h"
  10. namespace ash {
  11. // Controller of a feature pod button that toggles rotation lock mode.
  12. class ASH_EXPORT RotationLockFeaturePodController
  13. : public FeaturePodControllerBase,
  14. public TabletModeObserver,
  15. public ScreenOrientationController::Observer {
  16. public:
  17. RotationLockFeaturePodController();
  18. RotationLockFeaturePodController(const RotationLockFeaturePodController&) =
  19. delete;
  20. RotationLockFeaturePodController& operator=(
  21. const RotationLockFeaturePodController&) = delete;
  22. ~RotationLockFeaturePodController() override;
  23. // FeaturePodControllerBase:
  24. FeaturePodButton* CreateButton() override;
  25. void OnIconPressed() override;
  26. SystemTrayItemUmaType GetUmaType() const override;
  27. // TabletModeObserver:
  28. void OnTabletPhysicalStateChanged() override;
  29. // ScreenOrientationController::Observer:
  30. void OnUserRotationLockChanged() override;
  31. private:
  32. void UpdateButton();
  33. FeaturePodButton* button_ = nullptr;
  34. };
  35. } // namespace ash
  36. #endif // ASH_SYSTEM_ROTATION_ROTATION_LOCK_FEATURE_POD_CONTROLLER_H_