privacy_screen_feature_pod_controller.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_PRIVACY_SCREEN_PRIVACY_SCREEN_FEATURE_POD_CONTROLLER_H_
  5. #define ASH_SYSTEM_PRIVACY_SCREEN_PRIVACY_SCREEN_FEATURE_POD_CONTROLLER_H_
  6. #include "ash/display/privacy_screen_controller.h"
  7. #include "ash/system/unified/feature_pod_controller_base.h"
  8. namespace ash {
  9. // Controller of a feature pod button for toggling the built-in privacy screen.
  10. class PrivacyScreenFeaturePodController
  11. : public FeaturePodControllerBase,
  12. public PrivacyScreenController::Observer {
  13. public:
  14. PrivacyScreenFeaturePodController();
  15. ~PrivacyScreenFeaturePodController() override;
  16. PrivacyScreenFeaturePodController(const PrivacyScreenFeaturePodController&) =
  17. delete;
  18. PrivacyScreenFeaturePodController& operator=(
  19. const PrivacyScreenFeaturePodController&) = delete;
  20. // FeaturePodControllerBase:
  21. FeaturePodButton* CreateButton() override;
  22. void OnIconPressed() override;
  23. void OnLabelPressed() override;
  24. SystemTrayItemUmaType GetUmaType() const override;
  25. private:
  26. void TogglePrivacyScreen();
  27. void UpdateButton();
  28. // PrivacyScreenController::Observer:
  29. void OnPrivacyScreenSettingChanged(bool enabled, bool notify_ui) override;
  30. // Unowned.
  31. FeaturePodButton* button_ = nullptr;
  32. };
  33. } // namespace ash
  34. #endif // ASH_SYSTEM_PRIVACY_SCREEN_PRIVACY_SCREEN_FEATURE_POD_CONTROLLER_H_