2014-10-31 11:17:05 -07:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 17:49:37 +08:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2013-04-18 20:50:58 +08:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
|
|
|
|
#define ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
|
|
|
|
|
2013-07-01 21:56:46 +08:00
|
|
|
#include <string>
|
2013-04-18 20:50:58 +08:00
|
|
|
|
2014-10-27 16:56:28 +08:00
|
|
|
#include "base/strings/string16.h"
|
2014-11-04 17:59:15 +08:00
|
|
|
#include "ui/base/window_open_disposition.h"
|
2014-10-27 16:56:28 +08:00
|
|
|
#include "url/gurl.h"
|
|
|
|
|
2013-04-18 20:50:58 +08:00
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
class NativeWindowObserver {
|
|
|
|
public:
|
2013-04-18 23:50:47 +08:00
|
|
|
virtual ~NativeWindowObserver() {}
|
2013-04-18 20:50:58 +08:00
|
|
|
|
|
|
|
// Called when the web page of the window has updated it's document title.
|
|
|
|
virtual void OnPageTitleUpdated(bool* prevent_default,
|
2013-05-01 16:33:19 +08:00
|
|
|
const std::string& title) {}
|
|
|
|
|
2014-10-27 16:56:28 +08:00
|
|
|
// Called when the web page in window wants to create a popup window.
|
|
|
|
virtual void WillCreatePopupWindow(const base::string16& frame_name,
|
|
|
|
const GURL& target_url,
|
2014-11-04 17:59:15 +08:00
|
|
|
const std::string& partition_id,
|
|
|
|
WindowOpenDisposition disposition) {}
|
2014-10-27 16:56:28 +08:00
|
|
|
|
2014-12-17 14:40:19 -08:00
|
|
|
// Called when user is starting an navigation in web page.
|
|
|
|
virtual void WillNavigate(bool* prevent_default, const GURL& url) {}
|
|
|
|
|
2013-05-01 16:33:19 +08:00
|
|
|
// Called when the window is gonna closed.
|
|
|
|
virtual void WillCloseWindow(bool* prevent_default) {}
|
|
|
|
|
|
|
|
// Called when the window is closed.
|
|
|
|
virtual void OnWindowClosed() {}
|
2013-05-24 17:51:15 +08:00
|
|
|
|
|
|
|
// Called when window loses focus.
|
|
|
|
virtual void OnWindowBlur() {}
|
2013-06-06 19:45:48 +08:00
|
|
|
|
2014-05-21 13:46:13 -04:00
|
|
|
// Called when window gains focus.
|
|
|
|
virtual void OnWindowFocus() {}
|
|
|
|
|
2014-11-25 12:43:25 +08:00
|
|
|
// Called when window state changed.
|
|
|
|
virtual void OnWindowMaximize() {}
|
|
|
|
virtual void OnWindowUnmaximize() {}
|
|
|
|
virtual void OnWindowMinimize() {}
|
|
|
|
virtual void OnWindowRestore() {}
|
2015-05-09 21:25:10 +05:30
|
|
|
virtual void OnWindowResize() {}
|
|
|
|
virtual void OnWindowMove() {}
|
2015-05-20 14:07:13 +05:30
|
|
|
virtual void OnWindowMoved() {}
|
2014-11-25 12:43:25 +08:00
|
|
|
virtual void OnWindowEnterFullScreen() {}
|
|
|
|
virtual void OnWindowLeaveFullScreen() {}
|
2015-05-17 02:31:30 +05:30
|
|
|
virtual void OnWindowEnterHtmlFullScreen() {}
|
|
|
|
virtual void OnWindowLeaveHtmlFullScreen() {}
|
2014-11-25 12:43:25 +08:00
|
|
|
|
2015-06-05 17:01:17 +08:00
|
|
|
// Redirect devtools events.
|
2015-03-31 21:15:06 +05:30
|
|
|
virtual void OnDevToolsFocus() {}
|
2015-06-05 17:01:17 +08:00
|
|
|
virtual void OnDevToolsOpened() {}
|
|
|
|
virtual void OnDevToolsClosed() {}
|
2015-03-31 21:15:06 +05:30
|
|
|
|
2013-06-06 19:45:48 +08:00
|
|
|
// Called when renderer is hung.
|
|
|
|
virtual void OnRendererUnresponsive() {}
|
|
|
|
|
|
|
|
// Called when renderer recovers.
|
|
|
|
virtual void OnRendererResponsive() {}
|
2013-04-18 20:50:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
|
|
|
#endif // ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
|