window_cycle_tab_slider_button.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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_WM_WINDOW_CYCLE_WINDOW_CYCLE_TAB_SLIDER_BUTTON_H_
  5. #define ASH_WM_WINDOW_CYCLE_WINDOW_CYCLE_TAB_SLIDER_BUTTON_H_
  6. #include "ash/ash_export.h"
  7. #include "ui/base/metadata/metadata_header_macros.h"
  8. #include "ui/views/controls/button/label_button.h"
  9. namespace ash {
  10. // A button used in the WindowCycleTabSlider to choose between
  11. // all desks and current desks mode.
  12. class ASH_EXPORT WindowCycleTabSliderButton : public views::LabelButton {
  13. public:
  14. METADATA_HEADER(WindowCycleTabSliderButton);
  15. WindowCycleTabSliderButton(views::Button::PressedCallback callback,
  16. const std::u16string& label);
  17. WindowCycleTabSliderButton(const WindowCycleTabSliderButton&) = delete;
  18. WindowCycleTabSliderButton& operator=(const WindowCycleTabSliderButton&) =
  19. delete;
  20. ~WindowCycleTabSliderButton() override = default;
  21. // views::View:
  22. gfx::Size CalculatePreferredSize() const override;
  23. void SetToggled(bool is_toggled);
  24. private:
  25. bool toggled_ = false;
  26. };
  27. } // namespace ash
  28. #endif // ASH_WM_WINDOW_CYCLE_WINDOW_CYCLE_TAB_SLIDER_BUTTON_H_