window_list_observer.h 959 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2013 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_WINDOW_LIST_OBSERVER_H_
  5. #define ATOM_BROWSER_WINDOW_LIST_OBSERVER_H_
  6. #include "base/observer_list_types.h"
  7. namespace atom {
  8. class NativeWindow;
  9. class WindowListObserver : public base::CheckedObserver {
  10. public:
  11. // Called immediately after a window is added to the list.
  12. virtual void OnWindowAdded(NativeWindow* window) {}
  13. // Called immediately after a window is removed from the list.
  14. virtual void OnWindowRemoved(NativeWindow* window) {}
  15. // Called when a window close is cancelled by beforeunload handler.
  16. virtual void OnWindowCloseCancelled(NativeWindow* window) {}
  17. // Called immediately after all windows are closed.
  18. virtual void OnWindowAllClosed() {}
  19. protected:
  20. ~WindowListObserver() override {}
  21. };
  22. } // namespace atom
  23. #endif // ATOM_BROWSER_WINDOW_LIST_OBSERVER_H_