[go: nahoru, domu]

blob: e4d596af86cdcd56403e62013ef410dc113944ef [file] [log] [blame]
Avi Drissman3a215d1e2022-09-07 19:43:091// Copyright 2013 The Chromium Authors
James Cookb0bf8e82017-04-09 17:01:442// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef ASH_WM_WINDOW_STATE_DELEGATE_H_
6#define ASH_WM_WINDOW_STATE_DELEGATE_H_
7
Xiyuan Xiae3b80492022-03-29 16:17:278#include <memory>
9
James Cookb0bf8e82017-04-09 17:01:4410#include "ash/ash_export.h"
Xiyuan Xiae3b80492022-03-29 16:17:2711#include "ash/public/cpp/presentation_time_recorder.h"
James Cookb0bf8e82017-04-09 17:01:4412
Mitsuru Oshima89e5c1352018-01-17 07:29:3913namespace gfx {
Mitsuru Oshima624886482020-01-09 19:53:4014class PointF;
Mitsuru Oshima89e5c1352018-01-17 07:29:3915}
16
James Cookb0bf8e82017-04-09 17:01:4417namespace ash {
James Cook00e65e92019-07-25 03:19:0818
James Cookb0bf8e82017-04-09 17:01:4419class WindowState;
20
21class ASH_EXPORT WindowStateDelegate {
22 public:
23 WindowStateDelegate();
Peter Boströmec31a042021-09-16 23:37:3424
25 WindowStateDelegate(const WindowStateDelegate&) = delete;
26 WindowStateDelegate& operator=(const WindowStateDelegate&) = delete;
27
James Cookb0bf8e82017-04-09 17:01:4428 virtual ~WindowStateDelegate();
29
Sean Kau8542a122021-10-15 22:46:0630 // Toggles the window into or out of the fullscreen state. If the window is
31 // not fullscreen and the window supports immersive fullscreen
32 // ToggleFullscreen() should put the window into immersive fullscreen instead
33 // of the default fullscreen type. The caller (ash::WindowState) falls backs
34 // to the default implementation if this returns false.
James Cookb0bf8e82017-04-09 17:01:4435 virtual bool ToggleFullscreen(WindowState* window_state);
36
Sean Kau8542a122021-10-15 22:46:0637 // Toggles the locked fullscreen state, aka Pinned and TrustedPinned, where a
38 // window has exclusive control of the screen. Implementers should implement
39 // restrictions related to the relevant pinned mode for their window in this
40 // function.
41 virtual void ToggleLockedFullscreen(WindowState* window_state);
42
Mitsuru Oshima89e5c1352018-01-17 07:29:3943 // Invoked when the user started drag operation. |component| must be
44 // a member of ui::HitTestCompat enum and specifies which part of
45 // the window the pointer device was on when the user started drag
Xiyuan Xiae3b80492022-03-29 16:17:2746 // operation. Returns a presentation time recorder that could be used to
47 // track resize latency.
48 virtual std::unique_ptr<PresentationTimeRecorder> OnDragStarted(
49 int component);
Mitsuru Oshima89e5c1352018-01-17 07:29:3950
51 // Invoked when the user finished drag operation. |cancel| is true
52 // if the drag operation was canceled.
Mitsuru Oshima624886482020-01-09 19:53:4053 virtual void OnDragFinished(bool cancel, const gfx::PointF& location) {}
James Cookb0bf8e82017-04-09 17:01:4454};
55
James Cookb0bf8e82017-04-09 17:01:4456} // namespace ash
57
58#endif // ASH_WM_WINDOW_STATE_DELEGATE_H_