/atom/browser/native_window_observer.h

https://gitlab.com/lishaomin/electron · C Header · 70 lines · 38 code · 18 blank · 14 comment · 0 complexity · b091fbfe4179994c459f0409112fea55 MD5 · raw file

  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_NATIVE_WINDOW_OBSERVER_H_
  5. #define ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
  6. #include <string>
  7. #include "base/strings/string16.h"
  8. #include "ui/base/window_open_disposition.h"
  9. #include "url/gurl.h"
  10. namespace atom {
  11. class NativeWindowObserver {
  12. public:
  13. virtual ~NativeWindowObserver() {}
  14. // Called when the web page of the window has updated it's document title.
  15. virtual void OnPageTitleUpdated(bool* prevent_default,
  16. const std::string& title) {}
  17. // Called when the web page in window wants to create a popup window.
  18. virtual void WillCreatePopupWindow(const base::string16& frame_name,
  19. const GURL& target_url,
  20. const std::string& partition_id,
  21. WindowOpenDisposition disposition) {}
  22. // Called when user is starting an navigation in web page.
  23. virtual void WillNavigate(bool* prevent_default, const GURL& url) {}
  24. // Called when the window is gonna closed.
  25. virtual void WillCloseWindow(bool* prevent_default) {}
  26. // Called when the window is closed.
  27. virtual void OnWindowClosed() {}
  28. // Called when window loses focus.
  29. virtual void OnWindowBlur() {}
  30. // Called when window gains focus.
  31. virtual void OnWindowFocus() {}
  32. // Called when window state changed.
  33. virtual void OnWindowMaximize() {}
  34. virtual void OnWindowUnmaximize() {}
  35. virtual void OnWindowMinimize() {}
  36. virtual void OnWindowRestore() {}
  37. virtual void OnWindowResize() {}
  38. virtual void OnWindowMove() {}
  39. virtual void OnWindowMoved() {}
  40. virtual void OnWindowEnterFullScreen() {}
  41. virtual void OnWindowLeaveFullScreen() {}
  42. virtual void OnWindowEnterHtmlFullScreen() {}
  43. virtual void OnWindowLeaveHtmlFullScreen() {}
  44. // Called when renderer is hung.
  45. virtual void OnRendererUnresponsive() {}
  46. // Called when renderer recovers.
  47. virtual void OnRendererResponsive() {}
  48. // Called on Windows when App Commands arrive (WM_APPCOMMAND)
  49. virtual void OnExecuteWindowsCommand(const std::string& command_name) {}
  50. };
  51. } // namespace atom
  52. #endif // ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_