mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefAppManager and remove global ContentClient accessors (see issue #2969)
This is the first pass in removing direct dependencies on the Alloy runtime from code that can potentially be shared between runtimes. CefBrowserHost and CefRequestContext APIs (including CefCookieManager, CefURLRequest, etc.) are not yet implemented for the Chrome runtime. Assert early if these API methods are called while the Chrome runtime is enabled.
This commit is contained in:
@@ -5,8 +5,9 @@
|
||||
|
||||
#include "libcef/browser/alloy/chrome_profile_manager_alloy.h"
|
||||
|
||||
#include "libcef/browser/alloy/alloy_content_browser_client.h"
|
||||
#include "libcef/browser/browser_context.h"
|
||||
#include "libcef/browser/request_context_impl.h"
|
||||
#include "libcef/common/app_manager.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -21,8 +22,9 @@ namespace {
|
||||
// Return the main context for now since we don't currently have a good way to
|
||||
// determine that.
|
||||
CefBrowserContext* GetActiveBrowserContext() {
|
||||
return static_cast<CefBrowserContext*>(
|
||||
AlloyContentBrowserClient::Get()->request_context()->GetBrowserContext());
|
||||
auto request_context = static_cast<CefRequestContextImpl*>(
|
||||
CefAppManager::Get()->GetGlobalRequestContext().get());
|
||||
return static_cast<CefBrowserContext*>(request_context->GetBrowserContext());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user