mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
initial work on wrapping cookie visitor api
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "include/cef_runnable.h"
|
||||
#include "include/cef_version.h"
|
||||
#include "include/cef_task.h"
|
||||
#include "CookieVisitor.h"
|
||||
#include "Settings.h"
|
||||
#include "SchemeHandler.h"
|
||||
#include "StringUtil.h"
|
||||
@@ -119,6 +120,13 @@ namespace CefSharp
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool VisitAllCookies(ICookieVisitor^ visitor)
|
||||
{
|
||||
CefRefPtr<CookieVisitor> cookieVisitor = new CookieVisitor(visitor);
|
||||
return CefCookieManager::GetGlobalManager()->
|
||||
VisitAllCookies(static_cast<CefRefPtr<CefCookieVisitor>>(cookieVisitor));
|
||||
}
|
||||
|
||||
static bool SetCookie(String^ url, String^ name, String^ value, String^ domain, String^ path, bool secure, bool httponly, bool has_expires, DateTime expires)
|
||||
{
|
||||
msclr::lock l(_sync);
|
||||
|
||||
@@ -204,6 +204,10 @@
|
||||
RelativePath=".\ClientAdapter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CookieVisitor.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RenderClientAdapter.cpp"
|
||||
>
|
||||
@@ -290,6 +294,14 @@
|
||||
RelativePath=".\ConsoleMessageEventArgs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CookieVisitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ICookieVisitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\IKeyboardHandler.h"
|
||||
>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "CookieVisitor.h"
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
bool CookieVisitor::Visit(const CefCookie& cookie, int count, int total, bool& deleteCookie)
|
||||
{
|
||||
return _visitor->Visit(gcnew Cookie(), count, total, deleteCookie);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
#include "stdafx.h"
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_cookie.h"
|
||||
#include "ICookieVisitor.h"
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
public class CookieVisitor : public CefCookieVisitor
|
||||
{
|
||||
private:
|
||||
gcroot<ICookieVisitor^> _visitor;
|
||||
|
||||
public:
|
||||
CookieVisitor(ICookieVisitor^ visitor)
|
||||
{
|
||||
_visitor = visitor;
|
||||
}
|
||||
|
||||
virtual bool Visit(const CefCookie& cookie, int count, int total, bool& deleteCookie) OVERRIDE;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CookieVisitor);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "stdafx.h"
|
||||
#pragma once
|
||||
|
||||
using namespace System::Net;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
public interface class ICookieVisitor
|
||||
{
|
||||
public:
|
||||
bool Visit(Cookie^ cookie, int count, int total, bool% deleteCookie);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user