mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Create 2272 release branch for CEF3.
git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/2272@1993 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
66
tests/cefsimple/simple_handler.h
Normal file
66
tests/cefsimple/simple_handler.h
Normal file
@@ -0,0 +1,66 @@
|
||||
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_TESTS_CEFSIMPLE_SIMPLE_HANDLER_H_
|
||||
#define CEF_TESTS_CEFSIMPLE_SIMPLE_HANDLER_H_
|
||||
|
||||
#include "include/cef_client.h"
|
||||
|
||||
#include <list>
|
||||
|
||||
class SimpleHandler : public CefClient,
|
||||
public CefDisplayHandler,
|
||||
public CefLifeSpanHandler,
|
||||
public CefLoadHandler {
|
||||
public:
|
||||
SimpleHandler();
|
||||
~SimpleHandler();
|
||||
|
||||
// Provide access to the single global instance of this object.
|
||||
static SimpleHandler* GetInstance();
|
||||
|
||||
// CefClient methods:
|
||||
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() OVERRIDE {
|
||||
return this;
|
||||
}
|
||||
virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() OVERRIDE {
|
||||
return this;
|
||||
}
|
||||
virtual CefRefPtr<CefLoadHandler> GetLoadHandler() OVERRIDE {
|
||||
return this;
|
||||
}
|
||||
|
||||
// CefDisplayHandler methods:
|
||||
virtual void OnTitleChange(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& title) OVERRIDE;
|
||||
|
||||
// CefLifeSpanHandler methods:
|
||||
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
||||
virtual bool DoClose(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
||||
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
||||
|
||||
// CefLoadHandler methods:
|
||||
virtual void OnLoadError(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
ErrorCode errorCode,
|
||||
const CefString& errorText,
|
||||
const CefString& failedUrl) OVERRIDE;
|
||||
|
||||
// Request that all existing browser windows close.
|
||||
void CloseAllBrowsers(bool force_close);
|
||||
|
||||
bool IsClosing() const { return is_closing_; }
|
||||
|
||||
private:
|
||||
// List of existing browser windows. Only accessed on the CEF UI thread.
|
||||
typedef std::list<CefRefPtr<CefBrowser> > BrowserList;
|
||||
BrowserList browser_list_;
|
||||
|
||||
bool is_closing_;
|
||||
|
||||
// Include the default reference counting implementation.
|
||||
IMPLEMENT_REFCOUNTING(SimpleHandler);
|
||||
};
|
||||
|
||||
#endif // CEF_TESTS_CEFSIMPLE_SIMPLE_HANDLER_H_
|
Reference in New Issue
Block a user