2013-04-18 12:50:58 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
|
|
|
|
#define ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
|
|
|
|
|
2013-07-01 13:56:46 +00:00
|
|
|
#include <string>
|
2013-04-18 12:50:58 +00:00
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
class NativeWindowObserver {
|
|
|
|
public:
|
2013-04-18 15:50:47 +00:00
|
|
|
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,
|
2013-05-01 08:33:19 +00:00
|
|
|
const std::string& title) {}
|
|
|
|
|
2013-08-29 03:47:07 +00:00
|
|
|
// Called when the window is starting or is done loading a page.
|
2013-08-29 03:17:15 +00:00
|
|
|
virtual void OnLoadingStateChanged(bool is_loading) {}
|
|
|
|
|
2013-05-01 08:33:19 +00: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 09:51:15 +00:00
|
|
|
|
|
|
|
// Called when window loses focus.
|
|
|
|
virtual void OnWindowBlur() {}
|
2013-06-06 11:45:48 +00:00
|
|
|
|
|
|
|
// Called when renderer is hung.
|
|
|
|
virtual void OnRendererUnresponsive() {}
|
|
|
|
|
|
|
|
// Called when renderer recovers.
|
|
|
|
virtual void OnRendererResponsive() {}
|
2013-06-10 12:42:10 +00:00
|
|
|
|
2013-12-06 06:44:25 +00:00
|
|
|
// Called when a render view has been deleted.
|
2013-12-06 07:53:40 +00:00
|
|
|
virtual void OnRenderViewDeleted(int process_id, int routing_id) {}
|
2013-12-06 06:44:25 +00:00
|
|
|
|
2013-06-10 12:42:10 +00:00
|
|
|
// Called when renderer has crashed.
|
|
|
|
virtual void OnRendererCrashed() {}
|
2013-04-18 12:50:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
|
|
|
#endif // ATOM_BROWSER_NATIVE_WINDOW_OBSERVER_H_
|