fullscreen_control_view.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2017 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 COMPONENTS_FULLSCREEN_CONTROL_FULLSCREEN_CONTROL_VIEW_H_
  5. #define COMPONENTS_FULLSCREEN_CONTROL_FULLSCREEN_CONTROL_VIEW_H_
  6. #include "base/callback.h"
  7. #include "base/memory/raw_ptr.h"
  8. #include "ui/base/metadata/metadata_header_macros.h"
  9. #include "ui/views/controls/button/button.h"
  10. #include "ui/views/view.h"
  11. // FullscreenControlView shows a FAB (floating action button from the material
  12. // design spec) with close icon (i.e. a partially-transparent black circular
  13. // button with a "X" icon in the middle).
  14. // |callback| will be called when the user taps the button.
  15. class FullscreenControlView : public views::View {
  16. public:
  17. METADATA_HEADER(FullscreenControlView);
  18. explicit FullscreenControlView(views::Button::PressedCallback callback);
  19. FullscreenControlView(const FullscreenControlView&) = delete;
  20. FullscreenControlView& operator=(const FullscreenControlView&) = delete;
  21. ~FullscreenControlView() override;
  22. static constexpr int kCircleButtonDiameter = 48;
  23. views::Button* exit_fullscreen_button_for_testing() {
  24. return exit_fullscreen_button_;
  25. }
  26. private:
  27. raw_ptr<views::Button> exit_fullscreen_button_;
  28. };
  29. #endif // COMPONENTS_FULLSCREEN_CONTROL_FULLSCREEN_CONTROL_VIEW_H_