privacy_screen_toast_view.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_TOAST_VIEW_H_
  5. #define ASH_SYSTEM_PRIVACY_SCREEN_PRIVACY_SCREEN_TOAST_VIEW_H_
  6. #include "ash/ash_export.h"
  7. #include "ui/views/controls/button/button.h"
  8. #include "ui/views/view.h"
  9. #include "ui/views/view_observer.h"
  10. namespace ash {
  11. class FeaturePodIconButton;
  12. class PrivacyScreenToastLabelView;
  13. class PrivacyScreenToastController;
  14. // The view shown inside the privacy screen toast bubble.
  15. class ASH_EXPORT PrivacyScreenToastView : public views::View,
  16. public views::ViewObserver {
  17. public:
  18. PrivacyScreenToastView(PrivacyScreenToastController* controller,
  19. views::Button::PressedCallback callback);
  20. ~PrivacyScreenToastView() override;
  21. PrivacyScreenToastView(PrivacyScreenToastView&) = delete;
  22. PrivacyScreenToastView operator=(PrivacyScreenToastView&) = delete;
  23. // Updates the toast with whether the privacy screen is enabled and managed.
  24. void SetPrivacyScreenEnabled(bool enabled, bool managed);
  25. // Returns the accessible name for the view.
  26. std::u16string GetAccessibleName();
  27. // Returns true if the toggle button is focused.
  28. bool IsButtonFocused() const;
  29. private:
  30. // views::ViewObserver:
  31. void OnViewFocused(views::View* observed_view) override;
  32. void OnViewBlurred(views::View* observed_view) override;
  33. PrivacyScreenToastController* controller_ = nullptr;
  34. FeaturePodIconButton* button_ = nullptr;
  35. PrivacyScreenToastLabelView* label_ = nullptr;
  36. bool is_enabled_ = false;
  37. bool is_managed_ = false;
  38. };
  39. } // namespace ash
  40. #endif // ASH_SYSTEM_PRIVACY_SCREEN_PRIVACY_SCREEN_TOAST_VIEW_H_