window_state_observer.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_OBSERVER_H_
  5. #define ASH_WM_WINDOW_STATE_OBSERVER_H_
  6. #include "ash/ash_export.h"
  7. namespace chromeos {
  8. enum class WindowStateType;
  9. }
  10. namespace ash {
  11. class WindowState;
  12. class ASH_EXPORT WindowStateObserver {
  13. public:
  14. virtual ~WindowStateObserver() {}
  15. // Following observer methods are different from kWindowShowStatekey
  16. // property change as they will be invoked when the window
  17. // gets left/right maximized, and auto positioned. |old_type| is the value
  18. // before the change.
  19. // Called after the window's state type is set to new type, but before
  20. // the window's bounds has been updated for the new type.
  21. // This is used to update the shell state such as work area so
  22. // that the window can use the correct environment to update its bounds.
  23. virtual void OnPreWindowStateTypeChange(WindowState* window_state,
  24. chromeos::WindowStateType old_type) {}
  25. // Called after the window's state has been updated.
  26. // This is used to update the shell state that depends on the updated
  27. // window bounds, such as shelf visibility.
  28. virtual void OnPostWindowStateTypeChange(WindowState* window_state,
  29. chromeos::WindowStateType old_type) {
  30. }
  31. };
  32. } // namespace ash
  33. #endif // ASH_WM_WINDOW_STATE_OBSERVER_H_