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_BROWSER_BROWSER_MAIN_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_BROWSER_MAIN_H_
|
|
|
|
#pragma once
|
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
#include "libcef/browser/browser_context_impl.h"
|
2015-11-26 03:53:12 +01:00
|
|
|
#include "libcef/browser/net/url_request_context_getter_impl.h"
|
2013-02-06 21:41:54 +01:00
|
|
|
|
2016-01-06 20:20:54 +01:00
|
|
|
#include "base/macros.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "base/memory/scoped_ptr.h"
|
2013-09-03 18:43:31 +02:00
|
|
|
#include "base/memory/scoped_vector.h"
|
2013-04-16 00:16:01 +02:00
|
|
|
#include "base/strings/string_piece.h"
|
2016-01-06 20:20:54 +01:00
|
|
|
#include "build/build_config.h"
|
2016-02-05 01:49:19 +01:00
|
|
|
#include "components/prefs/pref_service.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "content/public/browser/browser_main_parts.h"
|
2013-09-03 18:43:31 +02:00
|
|
|
#include "net/url_request/url_request_context_getter.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
namespace base {
|
2013-04-16 00:16:01 +02:00
|
|
|
class MessageLoop;
|
2012-04-03 03:34:16 +02:00
|
|
|
class Thread;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace content {
|
|
|
|
struct MainFunctionParams;
|
|
|
|
}
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
namespace extensions {
|
|
|
|
class ExtensionsBrowserClient;
|
|
|
|
class ExtensionsClient;
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
class CefDevToolsDelegate;
|
|
|
|
|
|
|
|
class CefBrowserMainParts : public content::BrowserMainParts {
|
|
|
|
public:
|
|
|
|
explicit CefBrowserMainParts(const content::MainFunctionParams& parameters);
|
2014-11-12 20:25:15 +01:00
|
|
|
~CefBrowserMainParts() override;
|
|
|
|
|
|
|
|
void PreMainMessageLoopStart() override;
|
|
|
|
void PostMainMessageLoopStart() override;
|
|
|
|
void PreEarlyInitialization() override;
|
|
|
|
void ToolkitInitialized() override;
|
|
|
|
int PreCreateThreads() override;
|
|
|
|
void PreMainMessageLoopRun() override;
|
|
|
|
void PostMainMessageLoopRun() override;
|
|
|
|
void PostDestroyThreads() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
scoped_refptr<CefBrowserContextImpl> browser_context() const {
|
|
|
|
return global_browser_context_;
|
2013-09-03 18:43:31 +02:00
|
|
|
}
|
|
|
|
CefDevToolsDelegate* devtools_delegate() const {
|
2014-12-13 21:18:31 +01:00
|
|
|
return devtools_delegate_;
|
2013-09-03 18:43:31 +02:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
private:
|
2015-06-12 00:08:33 +02:00
|
|
|
#if defined(OS_WIN)
|
2012-04-03 03:34:16 +02:00
|
|
|
void PlatformInitialize();
|
2015-06-12 00:08:33 +02:00
|
|
|
void PlatformPreMainMessageLoopRun();
|
|
|
|
#endif // defined(OS_WIN)
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-02-14 00:17:08 +01:00
|
|
|
scoped_refptr<CefBrowserContextImpl> global_browser_context_;
|
2014-12-13 21:18:31 +01:00
|
|
|
CefDevToolsDelegate* devtools_delegate_; // Deletes itself.
|
2013-04-16 00:16:01 +02:00
|
|
|
scoped_ptr<base::MessageLoop> message_loop_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
scoped_ptr<extensions::ExtensionsClient> extensions_client_;
|
|
|
|
scoped_ptr<extensions::ExtensionsBrowserClient> extensions_browser_client_;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefBrowserMainParts);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_BROWSER_MAIN_H_
|