capture_mode_button.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_CAPTURE_MODE_CAPTURE_MODE_BUTTON_H_
  5. #define ASH_CAPTURE_MODE_CAPTURE_MODE_BUTTON_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/capture_mode/capture_mode_session_focus_cycler.h"
  8. #include "ui/base/metadata/metadata_header_macros.h"
  9. #include "ui/views/controls/button/image_button.h"
  10. namespace gfx {
  11. struct VectorIcon;
  12. } // namespace gfx
  13. namespace views {
  14. class FocusRing;
  15. } // namespace views
  16. namespace ash {
  17. // A view that shows a button which is part of the CaptureBarView.
  18. class ASH_EXPORT CaptureModeButton
  19. : public views::ImageButton,
  20. public CaptureModeSessionFocusCycler::HighlightableView {
  21. public:
  22. METADATA_HEADER(CaptureModeButton);
  23. CaptureModeButton(views::Button::PressedCallback callback,
  24. const gfx::VectorIcon& icon);
  25. CaptureModeButton(const CaptureModeButton&) = delete;
  26. CaptureModeButton& operator=(const CaptureModeButton&) = delete;
  27. ~CaptureModeButton() override = default;
  28. // Common configuration for CaptureModeButton and CaptureModeToggleButton,
  29. // such as InkDrop, preferred size, border, etc.
  30. static void ConfigureButton(views::ImageButton* button,
  31. views::FocusRing* focus_ring);
  32. // CaptureModeSessionFocusCycler::HighlightableView:
  33. views::View* GetView() override;
  34. };
  35. } // namespace ash
  36. #endif // ASH_CAPTURE_MODE_CAPTURE_MODE_BUTTON_H_