window_state_watcher.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (c) 2014 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_UI_X_WINDOW_STATE_WATCHER_H_
  5. #define ATOM_BROWSER_UI_X_WINDOW_STATE_WATCHER_H_
  6. #include "ui/events/platform/platform_event_observer.h"
  7. #include "atom/browser/native_window_views.h"
  8. namespace atom {
  9. class WindowStateWatcher : public ui::PlatformEventObserver {
  10. public:
  11. explicit WindowStateWatcher(NativeWindowViews* window);
  12. ~WindowStateWatcher() override;
  13. protected:
  14. // ui::PlatformEventObserver:
  15. void WillProcessEvent(const ui::PlatformEvent& event) override;
  16. void DidProcessEvent(const ui::PlatformEvent& event) override;
  17. private:
  18. bool IsWindowStateEvent(const ui::PlatformEvent& event);
  19. NativeWindowViews* window_;
  20. gfx::AcceleratedWidget widget_;
  21. bool was_minimized_ = false;
  22. bool was_maximized_ = false;
  23. DISALLOW_COPY_AND_ASSIGN(WindowStateWatcher);
  24. };
  25. } // namespace atom
  26. #endif // ATOM_BROWSER_UI_X_WINDOW_STATE_WATCHER_H_