blob: f7bbecbbdfeb08403222188c88743b15247a02ac [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2014 The Chromium Authors
[email protected]2d6eb742014-03-05 18:59:032// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef UI_AURA_WINDOW_TREE_HOST_OBSERVER_H_
6#define UI_AURA_WINDOW_TREE_HOST_OBSERVER_H_
7
yjliua98c7e432021-02-26 00:34:518#include "base/containers/flat_set.h"
9#include "components/viz/common/surfaces/frame_sink_id.h"
[email protected]2d6eb742014-03-05 18:59:0310#include "ui/aura/aura_export.h"
David Bienvenud0ddda32018-11-01 16:59:1611#include "ui/aura/window.h"
[email protected]2d6eb742014-03-05 18:59:0312
Scott Violet53091cdb22021-11-02 21:27:1213class SkRegion;
14
[email protected]2d6eb742014-03-05 18:59:0315namespace aura {
[email protected]2d6eb742014-03-05 18:59:0316class WindowTreeHost;
17
18class AURA_EXPORT WindowTreeHostObserver {
19 public:
20 // Called when the host's client size has changed.
Sadrul Habib Chowdhury97306372017-08-09 05:47:3421 virtual void OnHostResized(WindowTreeHost* host) {}
[email protected]2d6eb742014-03-05 18:59:0322
23 // Called when the host is moved on screen.
Mitsuru Oshima410e5dc32022-07-26 20:01:4324 virtual void OnHostMovedInPixels(WindowTreeHost* host) {}
[email protected]2d6eb742014-03-05 18:59:0325
thomasanderson06405c52016-05-03 22:52:2226 // Called when the host is moved to a different workspace.
Sadrul Habib Chowdhury97306372017-08-09 05:47:3427 virtual void OnHostWorkspaceChanged(WindowTreeHost* host) {}
thomasanderson06405c52016-05-03 22:52:2228
[email protected]2d6eb742014-03-05 18:59:0329 // Called when the native window system sends the host request to close.
Sadrul Habib Chowdhury97306372017-08-09 05:47:3430 virtual void OnHostCloseRequested(WindowTreeHost* host) {}
[email protected]2d6eb742014-03-05 18:59:0331
David Bienvenud0ddda32018-11-01 16:59:1632 // Called when the occlusion status of the native window changes, iff
33 // occlusion tracking is enabled for a descendant of the root.
34 virtual void OnOcclusionStateChanged(WindowTreeHost* host,
Scott Violet53091cdb22021-11-02 21:27:1235 Window::OcclusionState new_state,
36 const SkRegion& occluded_region) {}
David Bienvenud0ddda32018-11-01 16:59:1637
Scott Violet436e6252019-04-10 18:24:2338 // Called before processing a bounds change. The bounds change may result in
39 // one or both of OnHostResized() and OnHostMovedInPixels() being called.
40 // This is not supported by all WindowTreeHosts.
41 // OnHostWillProcessBoundsChange() is always followed by
42 // OnHostDidProcessBoundsChange().
43 virtual void OnHostWillProcessBoundsChange(WindowTreeHost* host) {}
44 virtual void OnHostDidProcessBoundsChange(WindowTreeHost* host) {}
45
yjliua98c7e432021-02-26 00:34:5146 virtual void OnCompositingFrameSinksToThrottleUpdated(
47 const aura::WindowTreeHost* host,
48 const base::flat_set<viz::FrameSinkId>& ids) {}
49
Andrew Wolfers79957f82024-08-16 19:08:5850 virtual void OnSetPreferredRefreshRate(WindowTreeHost* host,
51 float preferred_refresh_rate) {}
52
Mitsuru Oshimad470cb32024-12-04 00:24:3153 // Called when the local surface id of the frame sink embedded in `host` has
54 // changed.
55 virtual void OnLocalSurfaceIdChanged(WindowTreeHost* host,
56 const viz::LocalSurfaceId& id) {}
57
[email protected]2d6eb742014-03-05 18:59:0358 protected:
59 virtual ~WindowTreeHostObserver() {}
60};
61
62} // namespace aura
63
64#endif // UI_AURA_WINDOW_TREE_HOST_OBSERVER_H_