2014-10-31 18:17:05 +00:00
|
|
|
// 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-05-03 02:53:54 +00:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2014-03-16 00:58:59 +00:00
|
|
|
#ifndef ATOM_BROWSER_BROWSER_OBSERVER_H_
|
|
|
|
#define ATOM_BROWSER_BROWSER_OBSERVER_H_
|
2013-05-03 02:53:54 +00:00
|
|
|
|
2013-05-30 08:03:10 +00:00
|
|
|
#include <string>
|
|
|
|
|
2015-06-11 15:22:07 +00:00
|
|
|
#include "base/memory/scoped_ptr.h"
|
2015-06-26 04:04:15 +00:00
|
|
|
#include "content/public/browser/client_certificate_delegate.h"
|
2015-06-11 15:22:07 +00:00
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class WebContents;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace net {
|
|
|
|
class SSLCertRequestInfo;
|
|
|
|
}
|
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
namespace atom {
|
|
|
|
|
2015-10-28 11:34:01 +00:00
|
|
|
class LoginHandler;
|
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
class BrowserObserver {
|
|
|
|
public:
|
2015-02-26 03:33:42 +00:00
|
|
|
// The browser is about to close all windows.
|
|
|
|
virtual void OnBeforeQuit(bool* prevent_default) {}
|
2015-02-26 05:57:25 +00:00
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
// The browser has closed all windows and will quit.
|
|
|
|
virtual void OnWillQuit(bool* prevent_default) {}
|
|
|
|
|
|
|
|
// The browser has closed all windows. If the browser is quiting, then this
|
|
|
|
// method will not be called, instead it will call OnWillQuit.
|
|
|
|
virtual void OnWindowAllClosed() {}
|
|
|
|
|
2014-09-25 13:47:54 +00:00
|
|
|
// The browser is quitting.
|
|
|
|
virtual void OnQuit() {}
|
|
|
|
|
2013-05-30 08:03:10 +00:00
|
|
|
// The browser has opened a file by double clicking in Finder or dragging the
|
|
|
|
// file to the Dock icon. (OS X only)
|
|
|
|
virtual void OnOpenFile(bool* prevent_default,
|
|
|
|
const std::string& file_path) {}
|
|
|
|
|
2013-07-10 08:10:38 +00:00
|
|
|
// Browser is used to open a url.
|
|
|
|
virtual void OnOpenURL(const std::string& url) {}
|
|
|
|
|
2015-09-15 01:34:27 +00:00
|
|
|
// The browser is activated with visible/invisible windows (usually by
|
|
|
|
// clicking on the dock icon).
|
2015-09-15 02:05:53 +00:00
|
|
|
virtual void OnActivate(bool has_visible_windows) {}
|
2015-09-14 11:28:13 +00:00
|
|
|
|
2013-05-30 11:12:14 +00:00
|
|
|
// The browser has finished loading.
|
2013-06-03 07:31:46 +00:00
|
|
|
virtual void OnWillFinishLaunching() {}
|
2013-05-30 11:12:14 +00:00
|
|
|
virtual void OnFinishLaunching() {}
|
|
|
|
|
2015-06-11 15:22:07 +00:00
|
|
|
// The browser requires client certificate.
|
|
|
|
virtual void OnSelectCertificate(
|
|
|
|
content::WebContents* web_contents,
|
|
|
|
net::SSLCertRequestInfo* cert_request_info,
|
|
|
|
scoped_ptr<content::ClientCertificateDelegate> delegate) {}
|
|
|
|
|
2015-10-28 11:34:01 +00:00
|
|
|
// The browser requests HTTP login.
|
|
|
|
virtual void OnLogin(LoginHandler* login_handler) {}
|
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
protected:
|
|
|
|
virtual ~BrowserObserver() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
2014-03-16 00:58:59 +00:00
|
|
|
#endif // ATOM_BROWSER_BROWSER_OBSERVER_H_
|