autozoom_toast_view.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2022 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_CAMERA_AUTOZOOM_TOAST_VIEW_H_
  5. #define ASH_SYSTEM_CAMERA_AUTOZOOM_TOAST_VIEW_H_
  6. #include "ash/ash_export.h"
  7. #include "ui/views/controls/label.h"
  8. #include "ui/views/view.h"
  9. #include "ui/views/view_observer.h"
  10. namespace ash {
  11. class FeaturePodIconButton;
  12. class AutozoomToastController;
  13. // The view shown inside the autozoom toast bubble.
  14. class ASH_EXPORT AutozoomToastView : public views::View,
  15. public views::ViewObserver {
  16. public:
  17. explicit AutozoomToastView(AutozoomToastController* controller);
  18. AutozoomToastView(AutozoomToastView&) = delete;
  19. AutozoomToastView operator=(AutozoomToastView&) = delete;
  20. ~AutozoomToastView() override;
  21. // Updates the toast with whether autozoom is enabled.
  22. void SetAutozoomEnabled(bool enabled);
  23. // Returns the accessible name for the view.
  24. std::u16string GetAccessibleName();
  25. // Returns true if the toggle button is focused.
  26. bool IsButtonFocused() const;
  27. private:
  28. // views::ViewObserver:
  29. void OnViewFocused(views::View* observed_view) override;
  30. void OnViewBlurred(views::View* observed_view) override;
  31. AutozoomToastController* controller_ = nullptr;
  32. FeaturePodIconButton* button_ = nullptr;
  33. views::Label* label_ = nullptr;
  34. };
  35. } // namespace ash
  36. #endif // ASH_SYSTEM_CAMERA_AUTOZOOM_TOAST_VIEW_H_