window_tree_host_observer.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2014 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 UI_AURA_WINDOW_TREE_HOST_OBSERVER_H_
  5. #define UI_AURA_WINDOW_TREE_HOST_OBSERVER_H_
  6. #include "base/containers/flat_set.h"
  7. #include "components/viz/common/surfaces/frame_sink_id.h"
  8. #include "ui/aura/aura_export.h"
  9. #include "ui/aura/window.h"
  10. class SkRegion;
  11. namespace aura {
  12. class WindowTreeHost;
  13. class AURA_EXPORT WindowTreeHostObserver {
  14. public:
  15. // Called when the host's client size has changed.
  16. virtual void OnHostResized(WindowTreeHost* host) {}
  17. // Called when the host is moved on screen.
  18. virtual void OnHostMovedInPixels(WindowTreeHost* host) {}
  19. // Called when the host is moved to a different workspace.
  20. virtual void OnHostWorkspaceChanged(WindowTreeHost* host) {}
  21. // Called when the native window system sends the host request to close.
  22. virtual void OnHostCloseRequested(WindowTreeHost* host) {}
  23. // Called when the occlusion status of the native window changes, iff
  24. // occlusion tracking is enabled for a descendant of the root.
  25. virtual void OnOcclusionStateChanged(WindowTreeHost* host,
  26. Window::OcclusionState new_state,
  27. const SkRegion& occluded_region) {}
  28. // Called before processing a bounds change. The bounds change may result in
  29. // one or both of OnHostResized() and OnHostMovedInPixels() being called.
  30. // This is not supported by all WindowTreeHosts.
  31. // OnHostWillProcessBoundsChange() is always followed by
  32. // OnHostDidProcessBoundsChange().
  33. virtual void OnHostWillProcessBoundsChange(WindowTreeHost* host) {}
  34. virtual void OnHostDidProcessBoundsChange(WindowTreeHost* host) {}
  35. virtual void OnCompositingFrameSinksToThrottleUpdated(
  36. const aura::WindowTreeHost* host,
  37. const base::flat_set<viz::FrameSinkId>& ids) {}
  38. protected:
  39. virtual ~WindowTreeHostObserver() {}
  40. };
  41. } // namespace aura
  42. #endif // UI_AURA_WINDOW_TREE_HOST_OBSERVER_H_