custom_window_state_delegate.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 COMPONENTS_EXO_CUSTOM_WINDOW_STATE_DELEGATE_H_
  5. #define COMPONENTS_EXO_CUSTOM_WINDOW_STATE_DELEGATE_H_
  6. #include "ash/wm/window_state_delegate.h"
  7. namespace exo {
  8. class ShellSurface;
  9. // CustomWindowStateDelegate for ShellSurface to override default fullscreen
  10. // behavior and optionally provide a resize presentation time recorder for
  11. // ShellSurface.
  12. class CustomWindowStateDelegate : public ash::WindowStateDelegate {
  13. public:
  14. CustomWindowStateDelegate();
  15. explicit CustomWindowStateDelegate(ShellSurface* shell_surface);
  16. CustomWindowStateDelegate(const CustomWindowStateDelegate&) = delete;
  17. CustomWindowStateDelegate& operator=(const CustomWindowStateDelegate&) =
  18. delete;
  19. ~CustomWindowStateDelegate() override;
  20. // ash::WindowStateDelegate:
  21. bool ToggleFullscreen(ash::WindowState* window_state) override;
  22. void ToggleLockedFullscreen(ash::WindowState* window_state) override;
  23. std::unique_ptr<ash::PresentationTimeRecorder> OnDragStarted(
  24. int component) override;
  25. void OnDragFinished(bool cancel, const gfx::PointF& location) override;
  26. private:
  27. ShellSurface* const shell_surface_;
  28. };
  29. } // namespace exo
  30. #endif // COMPONENTS_EXO_CUSTOM_WINDOW_STATE_DELEGATE_H_