move CEF class definition into CefSharp.h header and move IBeforeResourceLoad into own header file

This commit is contained in:
chillitom
2010-12-07 15:14:57 +00:00
parent 17c243a6c8
commit 32eb277ae3
6 changed files with 76 additions and 75 deletions
+5 -18
View File
@@ -2,7 +2,7 @@
#pragma once
#include "HandlerAdapter.h"
#include "CefSharp.h"
#include "IBeforeResourceLoad.h"
using namespace System;
using namespace System::ComponentModel;
@@ -61,31 +61,18 @@ namespace CefSharp
property String^ Title
{
String^ get()
{
return _title;
}
String^ get() { return _title; }
}
property String^ Address
{
String^ get()
{
return _address;
}
String^ get() { return _address; }
}
property IBeforeResourceLoad^ BeforeResourceLoadHandler
{
IBeforeResourceLoad^ get()
{
return _beforeResourceLoadHandler;
}
void set(IBeforeResourceLoad^ handler)
{
_beforeResourceLoadHandler = handler;
}
IBeforeResourceLoad^ get() { return _beforeResourceLoadHandler; }
void set(IBeforeResourceLoad^ handler) { _beforeResourceLoadHandler = handler; }
}
property bool CanGoForward
-39
View File
@@ -30,45 +30,6 @@ public:
}
};*/
public ref class CEF sealed
{
public:
static property String^ CefSharpVersion
{
String^ get()
{
return "0.1";
}
}
static property String^ CefVersion
{
String^ get()
{
return "trunk r149";
}
}
static property String^ ChromiumVersion
{
String^ get()
{
return "trunk r66269";
}
}
static bool Initialize(Settings^ settings, BrowserSettings^ browserSettings)
{
return CefInitialize(*settings->_cefSettings, *browserSettings->_browserSettings);
}
static void Shutdown()
{
CefShutdown();
}
};
///////////////////////////////// END OF NAMESPACE
}
+33 -17
View File
@@ -12,25 +12,41 @@ using namespace System::IO;
namespace CefSharp
{
public interface class IBeforeResourceLoad
public ref class CEF sealed
{
public:
/* Event called before a resource is loaded.
To allow the resource to load normally return <c>ReturnValue.Continue</c>.
To redirect the resource to a new url populate the <c>redirectUrl</c> value
and return <c>ReturnValue.Continue</c>.
To specify data for the resource return a Stream object in <c>resourceStream</c>,
set <c>mimeType</c> to the resource stream's mime type, and return <c>ReturnValue.Continue</c>.
static property String^ CefSharpVersion
{
String^ get()
{
return "0.1";
}
}
To cancel loading of the resource return <c>ReturnValue.Handled</c>.
Any modifications to request will be observed. If the URL in <c>request</c> is changed and
<c>redirectUrl</c> is also set, the URL in <c>request</c> will be used. */
ReturnValue HandleBeforeResourceLoad(BrowserControl^ browserControl, IRequest^ request,
String^% redirectUrl, Stream^% resourceStream, String^% mimeType, int loadFlags);
static property String^ CefVersion
{
String^ get()
{
return "trunk r149";
}
}
static property String^ ChromiumVersion
{
String^ get()
{
return "trunk r66269";
}
}
static bool Initialize(Settings^ settings, BrowserSettings^ browserSettings)
{
return CefInitialize(*settings->_cefSettings, *browserSettings->_browserSettings);
}
static void Shutdown()
{
CefShutdown();
}
};
}
+4
View File
@@ -282,6 +282,10 @@
RelativePath=".\HandlerAdapter.h"
>
</File>
<File
RelativePath=".\IBeforeResourceLoad.h"
>
</File>
<File
RelativePath=".\JsResultHandler.h"
>
-1
View File
@@ -1,5 +1,4 @@
#include "stdafx.h"
#pragma once
namespace CefSharp
+34
View File
@@ -0,0 +1,34 @@
#include "stdafx.h"
#pragma once
#include "BrowserControl.h"
#include "Request.h"
#include "ReturnValue.h"
using namespace System;
using namespace System::IO;
namespace CefSharp
{
public interface class IBeforeResourceLoad
{
public:
/// Event called before a resource is loaded.
///
/// To allow the resource to load normally return <c>ReturnValue.Continue</c>.
///
/// To redirect the resource to a new url populate the <c>redirectUrl</c> value
/// and return <c>ReturnValue.Continue</c>.
///
/// To specify data for the resource return a Stream object in <c>resourceStream</c>,
/// set <c>mimeType</c> to the resource stream's mime type, and return <c>ReturnValue.Continue</c>.
///
/// To cancel loading of the resource return <c>ReturnValue.Handled</c>.
///
/// Any modifications to request will be observed. If the URL in <c>request</c> is changed and
/// <c>redirectUrl</c> is also set, the URL in <c>request</c> will be used. */
ReturnValue HandleBeforeResourceLoad(BrowserControl^ browserControl, IRequest^ request,
String^% redirectUrl, Stream^% resourceStream, String^% mimeType, int loadFlags);
};
}