window_state_delegate.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright 2013 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_STATE_DELEGATE_H_
  5. #define ASH_WM_WINDOW_STATE_DELEGATE_H_
  6. #include <memory>
  7. #include "ash/ash_export.h"
  8. #include "ash/public/cpp/presentation_time_recorder.h"
  9. namespace gfx {
  10. class PointF;
  11. }
  12. namespace ash {
  13. class WindowState;
  14. class ASH_EXPORT WindowStateDelegate {
  15. public:
  16. WindowStateDelegate();
  17. WindowStateDelegate(const WindowStateDelegate&) = delete;
  18. WindowStateDelegate& operator=(const WindowStateDelegate&) = delete;
  19. virtual ~WindowStateDelegate();
  20. // Toggles the window into or out of the fullscreen state. If the window is
  21. // not fullscreen and the window supports immersive fullscreen
  22. // ToggleFullscreen() should put the window into immersive fullscreen instead
  23. // of the default fullscreen type. The caller (ash::WindowState) falls backs
  24. // to the default implementation if this returns false.
  25. virtual bool ToggleFullscreen(WindowState* window_state);
  26. // Toggles the locked fullscreen state, aka Pinned and TrustedPinned, where a
  27. // window has exclusive control of the screen. Implementers should implement
  28. // restrictions related to the relevant pinned mode for their window in this
  29. // function.
  30. virtual void ToggleLockedFullscreen(WindowState* window_state);
  31. // Invoked when the user started drag operation. |component| must be
  32. // a member of ui::HitTestCompat enum and specifies which part of
  33. // the window the pointer device was on when the user started drag
  34. // operation. Returns a presentation time recorder that could be used to
  35. // track resize latency.
  36. virtual std::unique_ptr<PresentationTimeRecorder> OnDragStarted(
  37. int component);
  38. // Invoked when the user finished drag operation. |cancel| is true
  39. // if the drag operation was canceled.
  40. virtual void OnDragFinished(bool cancel, const gfx::PointF& location) {}
  41. };
  42. } // namespace ash
  43. #endif // ASH_WM_WINDOW_STATE_DELEGATE_H_