mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add initial Chrome runtime support for browser APIs (see issue #2969)
This change adds basic Chrome runtime implementations for CefBrowserContext and CefBrowserPlatformDelegate. A Chrome browser window with default frame and styling can now be created using CefBrowserHost::CreateBrowser and some CefClient callbacks will be triggered via the WebContentsObserver implementation in CefBrowserHostImpl. Any additional browser windows created via the Chrome UI will be unmanaged by CEF. The application message loop will block until all browser windows have been closed by the user.
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
#include "libcef/browser/chrome/browser_platform_delegate_chrome.h"
|
||||
#include "libcef/browser/extensions/browser_platform_delegate_background.h"
|
||||
#include "libcef/features/runtime_checks.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "libcef/browser/native/browser_platform_delegate_native_win.h"
|
||||
@@ -80,6 +82,8 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
|
||||
bool use_external_begin_frame = false;
|
||||
|
||||
if (is_windowless) {
|
||||
REQUIRE_ALLOY_RUNTIME();
|
||||
|
||||
use_shared_texture = create_params.window_info &&
|
||||
create_params.window_info->shared_texture_enabled;
|
||||
|
||||
@@ -88,6 +92,10 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
|
||||
create_params.window_info->external_begin_frame_enabled;
|
||||
}
|
||||
|
||||
if (cef::IsChromeRuntimeEnabled()) {
|
||||
return std::make_unique<CefBrowserPlatformDelegateChrome>(background_color);
|
||||
}
|
||||
|
||||
if (create_params.window_info) {
|
||||
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
|
||||
CreateNativeDelegate(*create_params.window_info.get(), background_color,
|
||||
|
Reference in New Issue
Block a user