From 19739abd9cc69529ecd06e86400e6f1068f14e6c Mon Sep 17 00:00:00 2001
From: amaitland <307872+amaitland@users.noreply.github.com>
Date: Wed, 18 Sep 2024 17:53:17 +1000
Subject: [PATCH] Remove Alloy Bootstrap (M128)
- Remove ChromeRuntime option
- Remove Extension Handling and related methods (no longer supported)
- Remove PackLoadingDisabled (no longer supported)
- Remove PersistUserPreferences (always on)
Resolves #4795
---
CefSharp.Core.Runtime/Cef.h | 3 +-
CefSharp.Core.Runtime/CefSettingsBase.h | 34 ---
.../CefSharp.Core.Runtime.vcxproj | 3 -
.../CefSharp.Core.Runtime.vcxproj.filters | 9 -
.../Internals/CefBrowserHostWrapper.cpp | 22 --
.../Internals/CefBrowserHostWrapper.h | 10 -
.../Internals/CefExtensionHandlerAdapter.h | 214 --------------
.../Internals/CefExtensionWrapper.cpp | 87 ------
.../Internals/CefExtensionWrapper.h | 55 ----
.../CefNavigationEntryVisitorAdapter.h | 1 +
CefSharp.Core.Runtime/RequestContext.cpp | 79 ------
CefSharp.Core.Runtime/RequestContext.h | 82 ------
.../RequestContextSettings.h | 12 -
CefSharp.Core/CefSettingsBase.cs | 34 ---
CefSharp.Core/RequestContext.cs | 40 ---
CefSharp.Core/RequestContextBuilder.cs | 22 +-
CefSharp.Core/RequestContextSettings.cs | 12 -
CefSharp.Example/Handlers/ExtensionHandler.cs | 70 -----
CefSharp.OffScreen/CefSettings.cs | 1 -
.../BrowserForm.Designer.cs | 116 ++++----
CefSharp.WinForms.Example/BrowserForm.cs | 59 ----
CefSharp.WinForms/CefSettings.cs | 2 -
CefSharp.Wpf.Example/MainWindow.xaml | 1 -
CefSharp.Wpf.Example/MainWindow.xaml.cs | 48 ----
CefSharp.Wpf/CefSettings.cs | 1 -
.../Callback/IGetExtensionResourceCallback.cs | 32 ---
CefSharp/DependencyChecker.cs | 6 +-
CefSharp/Enums/CefRuntimeStyle.cs | 12 +-
CefSharp/Handler/ExtensionHandler .cs | 261 ------------------
CefSharp/Handler/IExtensionHandler.cs | 103 -------
CefSharp/IBrowserHost.cs | 12 -
CefSharp/IExtension.cs | 64 -----
CefSharp/IRequestContext.cs | 79 ------
CefSharp/RequestContextExtensions.cs | 35 ---
34 files changed, 63 insertions(+), 1558 deletions(-)
delete mode 100644 CefSharp.Core.Runtime/Internals/CefExtensionHandlerAdapter.h
delete mode 100644 CefSharp.Core.Runtime/Internals/CefExtensionWrapper.cpp
delete mode 100644 CefSharp.Core.Runtime/Internals/CefExtensionWrapper.h
delete mode 100644 CefSharp.Example/Handlers/ExtensionHandler.cs
delete mode 100644 CefSharp/Callback/IGetExtensionResourceCallback.cs
delete mode 100644 CefSharp/Handler/ExtensionHandler .cs
delete mode 100644 CefSharp/Handler/IExtensionHandler.cs
delete mode 100644 CefSharp/IExtension.cs
diff --git a/CefSharp.Core.Runtime/Cef.h b/CefSharp.Core.Runtime/Cef.h
index 0301d2acf0..13f4f4123e 100644
--- a/CefSharp.Core.Runtime/Cef.h
+++ b/CefSharp.Core.Runtime/Cef.h
@@ -286,10 +286,9 @@ namespace CefSharp
PathCheck::AssertAbsolute(cefSettings->LocalesDirPath, "CefSettings.LocalesDirPath");
PathCheck::AssertAbsolute(cefSettings->BrowserSubprocessPath, "CefSettings.BrowserSubprocessPath");
-
if (performDependencyCheck)
{
- DependencyChecker::AssertAllDependenciesPresent(cefSettings->Locale, cefSettings->LocalesDirPath, cefSettings->ResourcesDirPath, cefSettings->PackLoadingDisabled, cefSettings->BrowserSubprocessPath);
+ DependencyChecker::AssertAllDependenciesPresent(cefSettings->Locale, cefSettings->LocalesDirPath, cefSettings->ResourcesDirPath, false, cefSettings->BrowserSubprocessPath);
}
else if (!File::Exists(cefSettings->BrowserSubprocessPath))
{
diff --git a/CefSharp.Core.Runtime/CefSettingsBase.h b/CefSharp.Core.Runtime/CefSettingsBase.h
index 55db47922f..98128b2000 100644
--- a/CefSharp.Core.Runtime/CefSettingsBase.h
+++ b/CefSharp.Core.Runtime/CefSettingsBase.h
@@ -84,18 +84,6 @@ namespace CefSharp
CommandLineArgDictionary^ get() { return _cefCommandLineArgs; }
}
- ///
- /// **Experimental**
- /// Set to true to enable use of the Chrome runtime in CEF. This feature is
- /// considered experimental and is not recommended for most users at this time.
- /// See issue https://github.com/chromiumembedded/cef/issues/2969
- ///
- property bool ChromeRuntime
- {
- bool get() { return _cefSettings->chrome_runtime == 1; }
- void set(bool value) { _cefSettings->chrome_runtime = value; }
- }
-
///
/// Set to true to disable configuration of browser process features using standard CEF and Chromium command-line arguments.
/// Configuration can still be specified using CEF data structures or by adding to CefCommandLineArgs.
@@ -235,17 +223,6 @@ namespace CefSharp
void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->javascript_flags, value); }
}
- ///
- /// Set to true to disable loading of pack files for resources and locales. A resource bundle handler must be provided for the
- /// browser and render processes via CefApp::GetResourceBundleHandler() if loading of pack files is disabled. Also configurable
- /// using the "disable-pack-loading" command- line switch.
- ///
- property bool PackLoadingDisabled
- {
- bool get() { return _cefSettings->pack_loading_disabled == 1; }
- void set(bool value) { _cefSettings->pack_loading_disabled = value; }
- }
-
///
/// Value that will be inserted as the product portion of the default User-Agent string. If empty the Chromium product version
/// will be used. If UserAgent is specified this value will be ignored. Also configurable using the "user-agent-product" command-
@@ -312,17 +289,6 @@ namespace CefSharp
void set(bool value) { _cefSettings->persist_session_cookies = value; }
}
- ///
- /// To persist user preferences as a JSON file in the cache path directory set this value to true. A CachePath value must also be
- /// specified to enable this feature. Also configurable using the "persist-user-preferences" command-line switch. Can be
- /// overridden for individual RequestContext instances via the RequestContextSettings.PersistUserPreferences value.
- ///
- property bool PersistUserPreferences
- {
- bool get() { return _cefSettings->persist_user_preferences == 1; }
- void set(bool value) { _cefSettings->persist_user_preferences = value; }
- }
-
///
/// Comma delimited ordered list of language codes without any whitespace that will be used in the "Accept-Language" HTTP header.
/// May be set globally using the CefSettings.AcceptLanguageList value. If both values are empty then "en-US,en" will be used.
diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj
index dd33e68655..0a1fab68d7 100644
--- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj
+++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj
@@ -239,7 +239,6 @@
-
@@ -277,8 +276,6 @@
-
-
diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters
index 5f6a9aec42..11ece6552f 100644
--- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters
+++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters
@@ -62,9 +62,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -259,12 +256,6 @@
Header Files
-
- Header Files
-
-
- Header Files
-
Header Files
diff --git a/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp b/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp
index 7068fe988a..5b8da2a87b 100644
--- a/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp
+++ b/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp
@@ -9,7 +9,6 @@
#include "include\cef_parser.h"
#include "Cef.h"
-#include "CefExtensionWrapper.h"
#include "CefTaskScheduler.h"
#include "DragData.h"
#include "CefRunFileDialogCallbackAdapter.h"
@@ -287,20 +286,6 @@ void CefBrowserHostWrapper::ReplaceMisspelling(String^ word)
_browserHost->ReplaceMisspelling(StringUtils::ToNative(word));
}
-IExtension^ CefBrowserHostWrapper::Extension::get()
-{
- ThrowIfDisposed();
-
- auto extension = _browserHost->GetExtension();
-
- if (extension.get())
- {
- return gcnew CefExtensionWrapper(_browserHost->GetExtension());
- }
-
- return nullptr;
-}
-
void CefBrowserHostWrapper::RunFileDialog(CefFileDialogMode mode, String^ title, String^ defaultFilePath, IList^ acceptFilters, IRunFileDialogCallback^ callback)
{
ThrowIfDisposed();
@@ -482,13 +467,6 @@ void CefBrowserHostWrapper::Invalidate(PaintElementType type)
_browserHost->Invalidate((CefBrowserHost::PaintElementType)type);
}
-bool CefBrowserHostWrapper::IsBackgroundHost::get()
-{
- ThrowIfDisposed();
-
- return _browserHost->IsBackgroundHost();
-}
-
void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange)
{
ThrowIfDisposed();
diff --git a/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h b/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h
index 2f2cd093b9..ca6bb5f5ca 100644
--- a/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h
+++ b/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h
@@ -81,11 +81,6 @@ namespace CefSharp
virtual void AddWordToDictionary(String^ word);
virtual void ReplaceMisspelling(String^ word);
- virtual property IExtension^ Extension
- {
- IExtension^ get();
- }
-
virtual void RunFileDialog(CefFileDialogMode mode, String^ title, String^ defaultFilePath, IList^ acceptFilters, IRunFileDialogCallback^ callback);
virtual void Find(String^ searchText, bool forward, bool matchCase, bool findNext);
@@ -102,11 +97,6 @@ namespace CefSharp
virtual void Invalidate(PaintElementType type);
- virtual property bool IsBackgroundHost
- {
- bool get();
- }
-
virtual void ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange);
virtual void ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos);
virtual void ImeFinishComposingText(bool keepSelection);
diff --git a/CefSharp.Core.Runtime/Internals/CefExtensionHandlerAdapter.h b/CefSharp.Core.Runtime/Internals/CefExtensionHandlerAdapter.h
deleted file mode 100644
index 14fa5278d6..0000000000
--- a/CefSharp.Core.Runtime/Internals/CefExtensionHandlerAdapter.h
+++ /dev/null
@@ -1,214 +0,0 @@
-// Copyright © 2018 The CefSharp Authors. All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
-
-#pragma once
-
-#include "Stdafx.h"
-
-#include "include\cef_extension.h"
-#include "include\cef_extension_handler.h"
-#include "BrowserSettings.h"
-#include "CefExtensionWrapper.h"
-#include "CefBrowserWrapper.h"
-#include "CefGetExtensionResourceCallbackWrapper.h"
-#include "WindowInfo.h"
-
-using namespace CefSharp;
-
-namespace CefSharp
-{
- namespace Internals
- {
- private class CefExtensionHandlerAdapter : public CefExtensionHandler
- {
- gcroot _handler;
-
- public:
- CefExtensionHandlerAdapter(IExtensionHandler^ handler)
- : _handler(handler)
- {
- }
-
- ~CefExtensionHandlerAdapter()
- {
- delete _handler;
- _handler = nullptr;
- }
-
- ///
- // Called if the CefRequestContext::LoadExtension request fails. |result| will
- // be the error code.
- ///
- /*--cef()--*/
- void OnExtensionLoadFailed(cef_errorcode_t result) override
- {
- _handler->OnExtensionLoadFailed((CefErrorCode)result);
- }
-
- ///
- // Called if the CefRequestContext::LoadExtension request succeeds.
- // |extension| is the loaded extension.
- ///
- /*--cef()--*/
- void OnExtensionLoaded(CefRefPtr extension) override
- {
- //TODO: Should this be auto disposed?
- _handler->OnExtensionLoaded(gcnew CefExtensionWrapper(extension));
- }
-
- ///
- // Called after the CefExtension::Unload request has completed.
- ///
- /*--cef()--*/
- void OnExtensionUnloaded(CefRefPtr extension) override
- {
- //TODO: Add comment to interface saying extension is only valid within the scope
- //of this method as it's auto disposed
- CefExtensionWrapper wrapper(extension);
- _handler->OnExtensionUnloaded(%wrapper);
- }
-
- ///
- // Called when an extension needs a browser to host a background script
- // specified via the "background" manifest key. The browser will have no
- // visible window and cannot be displayed. |extension| is the extension that
- // is loading the background script. |url| is an internally generated
- // reference to an HTML page that will be used to load the background script
- // via a