Remove compile-time checks for toolkit_views

The toolkit_views=true setting is supported (and now required) on all platforms.
This commit is contained in:
Marshall Greenblatt
2022-04-11 18:50:05 -04:00
parent a0a7a35fe2
commit 17cb26b8b9
15 changed files with 170 additions and 471 deletions

View File

@@ -13,7 +13,11 @@
#include "libcef/browser/browser_host_base.h"
#include "libcef/browser/chrome/browser_platform_delegate_chrome.h"
#include "libcef/browser/chrome/views/browser_platform_delegate_chrome_child_window.h"
#include "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h"
#include "libcef/browser/chrome/views/chrome_child_window.h"
#include "libcef/browser/extensions/browser_platform_delegate_background.h"
#include "libcef/browser/views/browser_platform_delegate_views.h"
#include "libcef/features/runtime_checks.h"
#if BUILDFLAG(IS_WIN)
@@ -29,13 +33,6 @@
#error A delegate implementation is not available for your platform.
#endif
#if defined(TOOLKIT_VIEWS)
#include "libcef/browser/chrome/views/browser_platform_delegate_chrome_child_window.h"
#include "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h"
#include "libcef/browser/chrome/views/chrome_child_window.h"
#include "libcef/browser/views/browser_platform_delegate_views.h"
#endif
namespace {
std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
@@ -90,7 +87,6 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(window_info, background_color);
#if defined(TOOLKIT_VIEWS)
if (create_params.window_info) {
// CefWindowInfo should only be set if a parent handle was specified.
DCHECK(chrome_child_window::HasParentHandle(window_info));
@@ -104,13 +100,11 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
std::move(native_delegate),
static_cast<CefBrowserViewImpl*>(create_params.browser_view.get()));
}
#endif // defined(TOOLKIT_VIEWS)
return std::make_unique<CefBrowserPlatformDelegateChrome>(
std::move(native_delegate));
}
#if defined(TOOLKIT_VIEWS)
if (create_params.browser_view ||
create_params.popup_with_views_hosted_opener) {
// CefWindowInfo is not used in this case.
@@ -119,11 +113,8 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
return std::make_unique<CefBrowserPlatformDelegateViews>(
std::move(native_delegate),
static_cast<CefBrowserViewImpl*>(create_params.browser_view.get()));
}
#endif // defined(TOOLKIT_VIEWS)
if (create_params.extension_host_type ==
extensions::mojom::ViewType::kExtensionBackgroundPage) {
} else if (create_params.extension_host_type ==
extensions::mojom::ViewType::kExtensionBackgroundPage) {
// Creating a background extension host without a window.
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(CefWindowInfo(), background_color);