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-11-26 03:53:12 +01:00
|
|
|
#include "libcef/browser/net/url_request_context_getter_impl.h"
|
2017-05-04 23:53:27 +02:00
|
|
|
#include "libcef/browser/request_context_impl.h"
|
2013-02-06 21:41:54 +01:00
|
|
|
|
2016-01-06 20:20:54 +01:00
|
|
|
#include "base/macros.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;
|
2017-07-27 01:19:27 +02:00
|
|
|
} // namespace base
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
namespace content {
|
|
|
|
struct MainFunctionParams;
|
|
|
|
}
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
namespace extensions {
|
|
|
|
class ExtensionsBrowserClient;
|
|
|
|
class ExtensionsClient;
|
2017-07-27 01:19:27 +02:00
|
|
|
} // namespace extensions
|
2015-07-16 23:40:01 +02:00
|
|
|
|
2017-04-26 18:49:30 +02:00
|
|
|
#if defined(USE_AURA)
|
|
|
|
namespace wm {
|
|
|
|
class WMState;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
2017-05-04 23:53:27 +02:00
|
|
|
CefRefPtr<CefRequestContextImpl> request_context() const {
|
|
|
|
return global_request_context_;
|
2013-09-03 18:43:31 +02:00
|
|
|
}
|
2017-05-17 11:29:28 +02:00
|
|
|
CefDevToolsDelegate* devtools_delegate() const { return devtools_delegate_; }
|
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
|
|
|
#endif // defined(OS_WIN)
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-05-04 23:53:27 +02:00
|
|
|
CefRefPtr<CefRequestContextImpl> global_request_context_;
|
2014-12-13 21:18:31 +01:00
|
|
|
CefDevToolsDelegate* devtools_delegate_; // Deletes itself.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<base::MessageLoop> message_loop_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<extensions::ExtensionsClient> extensions_client_;
|
2017-05-17 11:29:28 +02:00
|
|
|
std::unique_ptr<extensions::ExtensionsBrowserClient>
|
|
|
|
extensions_browser_client_;
|
2015-07-16 23:40:01 +02:00
|
|
|
|
2017-04-26 18:49:30 +02:00
|
|
|
#if defined(USE_AURA)
|
|
|
|
std::unique_ptr<wm::WMState> wm_state_;
|
|
|
|
#endif
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefBrowserMainParts);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_BROWSER_MAIN_H_
|