2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2011 The Chromium 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_LIBCEF_COMMON_MAIN_DELEGATE_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_MAIN_DELEGATE_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "libcef/common/content_client.h"
|
|
|
|
#include "include/cef_app.h"
|
|
|
|
|
|
|
|
#include "base/compiler_specific.h"
|
|
|
|
#include "base/memory/scoped_ptr.h"
|
|
|
|
#include "content/public/app/content_main_delegate.h"
|
|
|
|
|
2012-04-11 20:00:55 +02:00
|
|
|
namespace base {
|
|
|
|
class Thread;
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
namespace content {
|
|
|
|
class BrowserMainRunner;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CefContentBrowserClient;
|
|
|
|
class CefContentRendererClient;
|
|
|
|
class CefContentPluginClient;
|
|
|
|
class CefContentUtilityClient;
|
|
|
|
class MessageLoop;
|
|
|
|
|
|
|
|
class CefMainDelegate : public content::ContentMainDelegate {
|
|
|
|
public:
|
|
|
|
explicit CefMainDelegate(CefRefPtr<CefApp> application);
|
|
|
|
virtual ~CefMainDelegate();
|
|
|
|
|
|
|
|
virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
|
|
|
|
virtual void PreSandboxStartup() OVERRIDE;
|
|
|
|
virtual int RunProcess(
|
|
|
|
const std::string& process_type,
|
|
|
|
const content::MainFunctionParams& main_function_params) OVERRIDE;
|
|
|
|
virtual void ProcessExiting(const std::string& process_type) OVERRIDE;
|
2012-06-22 00:50:34 +02:00
|
|
|
virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE;
|
|
|
|
virtual content::ContentRendererClient*
|
|
|
|
CreateContentRendererClient() OVERRIDE;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Shut down the browser runner.
|
|
|
|
void ShutdownBrowser();
|
|
|
|
|
|
|
|
CefContentBrowserClient* browser_client() { return browser_client_.get(); }
|
|
|
|
CefContentClient* content_client() { return &content_client_; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void InitializeResourceBundle();
|
|
|
|
|
|
|
|
scoped_ptr<content::BrowserMainRunner> browser_runner_;
|
2012-04-11 20:00:55 +02:00
|
|
|
scoped_ptr<base::Thread> ui_thread_;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
scoped_ptr<CefContentBrowserClient> browser_client_;
|
|
|
|
scoped_ptr<CefContentRendererClient> renderer_client_;
|
|
|
|
CefContentClient content_client_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefMainDelegate);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_MAIN_DELEGATE_H_
|