electron/atom/browser/native_window_observer.h

78 lines
2.5 KiB
C
Raw Normal View History

// Copyright (c) 2013 GitHub, Inc.
2014-04-25 09:49:37 +00:00
// Use of this source code is governed by the MIT license that can be
2013-04-18 12:50:58 +00:00
// found in the LICENSE file.
#ifndef ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
#define ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
#include <string>
2013-04-18 12:50:58 +00:00
#include "base/strings/string16.h"
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
2013-04-18 12:50:58 +00:00
namespace atom {
class NativeWindowObserver {
public:
virtual ~NativeWindowObserver() {}
2013-04-18 12:50:58 +00:00
// Called when the web page of the window has updated it's document title.
virtual void OnPageTitleUpdated(bool* prevent_default,
const std::string& title) {}
// 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,
const std::string& partition_id,
WindowOpenDisposition disposition) {}
2015-08-27 09:22:39 +00:00
virtual void OnFrameRendered(scoped_ptr<uint8[]> rgb, const int size) {}
// Called when user is starting an navigation in web page.
virtual void WillNavigate(bool* prevent_default, const GURL& url) {}
// Called when the window is gonna closed.
virtual void WillCloseWindow(bool* prevent_default) {}
// Called when the window is closed.
virtual void OnWindowClosed() {}
// Called when window loses focus.
virtual void OnWindowBlur() {}
// Called when window gains focus.
virtual void OnWindowFocus() {}
2014-11-25 04:43:25 +00:00
// Called when window state changed.
virtual void OnWindowMaximize() {}
virtual void OnWindowUnmaximize() {}
virtual void OnWindowMinimize() {}
virtual void OnWindowRestore() {}
2015-05-09 15:55:10 +00:00
virtual void OnWindowResize() {}
virtual void OnWindowMove() {}
2015-05-20 08:37:13 +00:00
virtual void OnWindowMoved() {}
2014-11-25 04:43:25 +00:00
virtual void OnWindowEnterFullScreen() {}
virtual void OnWindowLeaveFullScreen() {}
virtual void OnWindowEnterHtmlFullScreen() {}
virtual void OnWindowLeaveHtmlFullScreen() {}
2014-11-25 04:43:25 +00:00
2015-06-05 09:01:17 +00:00
// Redirect devtools events.
virtual void OnDevToolsFocus() {}
2015-06-05 09:01:17 +00:00
virtual void OnDevToolsOpened() {}
virtual void OnDevToolsClosed() {}
// Called when renderer is hung.
virtual void OnRendererUnresponsive() {}
// Called when renderer recovers.
virtual void OnRendererResponsive() {}
// Called on Windows when App Commands arrive (WM_APPCOMMAND)
2015-06-25 21:09:25 +00:00
virtual void OnExecuteWindowsCommand(const std::string& command_name) {}
2013-04-18 12:50:58 +00:00
};
} // namespace atom
#endif // ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_