mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 03:32:37 +00:00
Core - Add AddPreferenceObserver support. (#5279)
* Core - Add `AddPreferenceObserver` support.
This commit is contained in:
@@ -11,9 +11,12 @@
|
||||
#include "Internals\CefSchemeHandlerFactoryAdapter.h"
|
||||
#include "Internals\CefCompletionCallbackAdapter.h"
|
||||
#include "Internals\CefResolveCallbackAdapter.h"
|
||||
#include "Internals\PreferenceObserverAdapter.h"
|
||||
#include "Internals\TypeConversion.h"
|
||||
#include "Internals\CefRegistrationWrapper.h"
|
||||
|
||||
using namespace System::Runtime::InteropServices;
|
||||
using namespace CefSharp::Callback;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
@@ -117,6 +120,17 @@ namespace CefSharp
|
||||
return success;
|
||||
}
|
||||
|
||||
IRegistration^ RequestContext::AddPreferenceObserver(String^ name, IPreferenceObserver^ observer)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
ThrowIfExecutedOnNonCefUiThread();
|
||||
|
||||
auto registration = _requestContext->AddPreferenceObserver(StringUtils::ToNative(name), new PreferenceObserverAdapter(observer));
|
||||
|
||||
return gcnew CefRegistrationWrapper(registration);
|
||||
}
|
||||
|
||||
void RequestContext::ClearCertificateExceptions(ICompletionCallback^ callback)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
Reference in New Issue
Block a user