mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-13 10:06:28 +01:00
4f301a098b
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2019 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
75 lines
2.3 KiB
C++
75 lines
2.3 KiB
C++
// 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_CEFCLIENT_BROWSER_CLIENT_APP_BROWSER_H_
|
|
#define CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_APP_BROWSER_H_
|
|
#pragma once
|
|
|
|
#include <set>
|
|
|
|
#include "cefclient/common/client_app.h"
|
|
|
|
namespace client {
|
|
|
|
// Client app implementation for the browser process.
|
|
class ClientAppBrowser : public ClientApp,
|
|
public CefBrowserProcessHandler {
|
|
public:
|
|
// Interface for browser delegates. All Delegates must be returned via
|
|
// CreateDelegates. Do not perform work in the Delegate
|
|
// constructor. See CefBrowserProcessHandler for documentation.
|
|
class Delegate : public virtual CefBase {
|
|
public:
|
|
virtual void OnContextInitialized(CefRefPtr<ClientApp> app) {}
|
|
|
|
virtual void OnBeforeChildProcessLaunch(
|
|
CefRefPtr<ClientAppBrowser> app,
|
|
CefRefPtr<CefCommandLine> command_line) {}
|
|
|
|
virtual void OnRenderProcessThreadCreated(
|
|
CefRefPtr<ClientAppBrowser> app,
|
|
CefRefPtr<CefListValue> extra_info) {}
|
|
};
|
|
|
|
typedef std::set<CefRefPtr<Delegate> > DelegateSet;
|
|
|
|
ClientAppBrowser();
|
|
|
|
private:
|
|
// Creates all of the Delegate objects. Implemented by cefclient in
|
|
// client_app_delegates_browser.cc
|
|
static void CreateDelegates(DelegateSet& delegates);
|
|
|
|
// Create the Linux print handler. Implemented by cefclient in
|
|
// client_app_delegates_browser.cc
|
|
static CefRefPtr<CefPrintHandler> CreatePrintHandler();
|
|
|
|
// CefApp methods.
|
|
CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() OVERRIDE {
|
|
return this;
|
|
}
|
|
|
|
// CefBrowserProcessHandler methods.
|
|
void OnContextInitialized() OVERRIDE;
|
|
void OnBeforeChildProcessLaunch(
|
|
CefRefPtr<CefCommandLine> command_line) OVERRIDE;
|
|
void OnRenderProcessThreadCreated(
|
|
CefRefPtr<CefListValue> extra_info) OVERRIDE;
|
|
CefRefPtr<CefPrintHandler> GetPrintHandler() OVERRIDE {
|
|
return print_handler_;
|
|
}
|
|
|
|
// Set of supported Delegates.
|
|
DelegateSet delegates_;
|
|
|
|
CefRefPtr<CefPrintHandler> print_handler_;
|
|
|
|
IMPLEMENT_REFCOUNTING(ClientAppBrowser);
|
|
DISALLOW_COPY_AND_ASSIGN(ClientAppBrowser);
|
|
};
|
|
|
|
} // namespace client
|
|
|
|
#endif // CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_APP_BROWSER_H_
|