Merge branch 'master' into cef1

Conflicts:
	CefSharp.WinFormsExample/Browser.cs
	CefSharp/CefFormsWebBrowser.cpp
	CefSharp/CefFormsWebBrowser.h
	CefSharp/CefSharp.cpp
	CefSharp/CefWpfWebBrowser.cpp
	CefSharp/CefWpfWebBrowser.h
	CefSharp/ManagedCefRefPtr.h
	CefSharp/OffscreenClientAdapter.h
	CefSharp/ReadMe.txt
	CefSharp/ScriptException.h
	CefSharp/app.rc
	include/cef.h
	include/internal/cef_types_win.h
This commit is contained in:
anthony taranto
2012-02-17 19:17:29 -08:00
39 changed files with 177 additions and 168 deletions
+1 -2
View File
@@ -84,8 +84,7 @@ namespace CefSharp
void WebBrowser::Back()
{
WaitForInitialized();
_clientAdapter->GetCefBrowser()->StopLoad();
_clientAdapter->GetCefBrowser()->GoBack();
}
void WebBrowser::Forward()
+18 -18
View File
@@ -38,9 +38,9 @@
this.tableLayoutPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit();
this.SuspendLayout();
//
//
// tableLayoutPanel
//
//
this.tableLayoutPanel.ColumnCount = 2;
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.15982F));
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 64.84018F));
@@ -63,9 +63,9 @@
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.Size = new System.Drawing.Size(438, 263);
this.tableLayoutPanel.TabIndex = 0;
//
//
// logoPictureBox
//
//
this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.logoPictureBox.Image = global::CefSharp.Example.Properties.Resources.chromium256;
this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
@@ -74,9 +74,9 @@
this.logoPictureBox.Size = new System.Drawing.Size(148, 257);
this.logoPictureBox.TabIndex = 12;
this.logoPictureBox.TabStop = false;
//
//
// labelProductName
//
//
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProductName.Location = new System.Drawing.Point(160, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
@@ -86,9 +86,9 @@
this.labelProductName.TabIndex = 19;
this.labelProductName.Text = "Product Name";
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
//
// labelVersion
//
//
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.Location = new System.Drawing.Point(160, 26);
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
@@ -98,9 +98,9 @@
this.labelVersion.TabIndex = 0;
this.labelVersion.Text = "Version";
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
//
// labelCopyright
//
//
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCopyright.Location = new System.Drawing.Point(160, 52);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
@@ -110,9 +110,9 @@
this.labelCopyright.TabIndex = 21;
this.labelCopyright.Text = "Copyright";
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
//
// labelCompanyName
//
//
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCompanyName.Location = new System.Drawing.Point(160, 78);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
@@ -122,9 +122,9 @@
this.labelCompanyName.TabIndex = 22;
this.labelCompanyName.Text = "Company Name";
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
//
// textBoxDescription
//
//
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxDescription.Location = new System.Drawing.Point(160, 107);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
@@ -136,9 +136,9 @@
this.textBoxDescription.TabIndex = 23;
this.textBoxDescription.TabStop = false;
this.textBoxDescription.Text = "Description";
//
//
// okButton
//
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(360, 238);
@@ -146,9 +146,9 @@
this.okButton.Size = new System.Drawing.Size(75, 22);
this.okButton.TabIndex = 24;
this.okButton.Text = "&OK";
//
//
// AboutBox
//
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CefSharp.WinFormsExample
labelCompanyName.Text = AssemblyCompany;
textBoxDescription.Text = "CefSharp - .Net binding for Chromium\r\n\r\n"
+ "Built on Chromium Embedded Framework\r\n"
+ " - " + CEF.CefVersion + "\r\n"
+ " - " + CEF.CefVersion + "\r\n"
+ "Built on Chromium\r\n"
+ " - " + CEF.ChromiumVersion + "\r\n";
}
+5 -5
View File
@@ -64,8 +64,8 @@ namespace CefSharp.WinFormsExample
}
else
{
_browserControl.Load(urlTextBox.Text);
}
_browserControl.Load(urlTextBox.Text);
}
}
private void HandleBackButtonClick(object sender, EventArgs e)
@@ -168,7 +168,7 @@ namespace CefSharp.WinFormsExample
}
private void TestRunArbitraryJavaScriptToolStripMenuItemClick(object sender, EventArgs e)
{
{
InputForm inputForm = new InputForm();
if(inputForm.ShowDialog() == DialogResult.OK)
{
@@ -177,7 +177,7 @@ namespace CefSharp.WinFormsExample
{
string result = _browserControl.RunScript(script);
MessageBox.Show(result, "Result");
}
}
catch(Exception err)
{
MessageBox.Show(err.ToString(), "Error");
@@ -191,7 +191,7 @@ namespace CefSharp.WinFormsExample
}
private void TestConsoleMessagesToolStripMenuItemClick(object sender, EventArgs e)
{
{
_browserControl.Load("javascript:console.log('console log message text')");
}
+6 -6
View File
@@ -31,16 +31,16 @@
this.input = new System.Windows.Forms.TextBox();
this.enterButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
//
// input
//
//
this.input.Location = new System.Drawing.Point(12, 12);
this.input.Name = "input";
this.input.Size = new System.Drawing.Size(419, 20);
this.input.TabIndex = 0;
//
//
// enterButton
//
//
this.enterButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.enterButton.Location = new System.Drawing.Point(437, 9);
this.enterButton.Name = "enterButton";
@@ -48,9 +48,9 @@
this.enterButton.TabIndex = 1;
this.enterButton.Text = "Enter";
this.enterButton.UseVisualStyleBackColor = true;
//
//
// InputForm
//
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(525, 46);
@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CefTest")]
@@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -25,11 +25,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
+18 -18
View File
@@ -10,8 +10,8 @@
namespace CefSharp.Example.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -23,15 +23,15 @@ namespace CefSharp.Example.Properties {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
@@ -45,7 +45,7 @@ namespace CefSharp.Example.Properties {
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
@@ -59,7 +59,7 @@ namespace CefSharp.Example.Properties {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
///&lt;html&gt;
@@ -68,11 +68,11 @@ namespace CefSharp.Example.Properties {
/// &lt;/head&gt;
/// &lt;body&gt;
/// &lt;p&gt;
/// Result of calling bound.Repeat(&quot;hi &quot;, 5) =
/// Result of calling bound.Repeat(&quot;hi &quot;, 5) =
/// &lt;script type=&quot;text/javascript&quot;&gt;
/// var result = bound.Repeat(&quot;hi &quot;, 5);
/// document.write(&apos;&quot;&apos; + result + &apos;&quot;&apos;);
/// if(result == &quot;hi hi hi hi hi &quot;)
/// if(result == &quot;hi hi hi hi hi &quot;)
/// {
/// document.write(&quot; SUCCESS&quot;);
/// }
@@ -86,42 +86,42 @@ namespace CefSharp.Example.Properties {
return ResourceManager.GetString("BindingTest", resourceCulture);
}
}
internal static System.Drawing.Bitmap chromium256 {
get {
object obj = ResourceManager.GetObject("chromium256", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap nav_left_green {
get {
object obj = ResourceManager.GetObject("nav_left_green", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap nav_plain_green {
get {
object obj = ResourceManager.GetObject("nav_plain_green", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap nav_plain_red {
get {
object obj = ResourceManager.GetObject("nav_plain_red", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap nav_right_green {
get {
object obj = ResourceManager.GetObject("nav_right_green", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
///&lt;html&gt;
@@ -139,7 +139,7 @@ namespace CefSharp.Example.Properties {
return ResourceManager.GetString("PopupTest", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
///&lt;html&gt;
@@ -157,7 +157,7 @@ namespace CefSharp.Example.Properties {
return ResourceManager.GetString("SchemeTest", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
///&lt;html&gt;
@@ -5,28 +5,28 @@
</head>
<body>
<p>
Result of calling bound.Repeat("hi ", 5) =
Result of calling bound.Repeat("hi ", 5) =
<script type="text/javascript">
var result = bound.Repeat("hi ", 5);
document.write('"' + result + '"');
if(result == "hi hi hi hi hi ")
if(result == "hi hi hi hi hi ")
{
document.write(" SUCCESS");
}
else
{
document.write(" FAIL!");
}
}
</script>
</p>
Methods on bound object 'bound':<br />
<ul>
<script type="text/javascript">
for(var name in bound) {
document.write("<li>" + name + "</li>");
}
</script>
</ul>
</script>
</ul>
</body>
</html>
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CefSharp.WinFormsExample
/*
[Test]
public void MultiThreadedMessageLoop()
{
{
Assert.That(_settings.MultiThreadedMessageLoop, Is.False);
_settings.MultiThreadedMessageLoop = true;
Assert.That(_settings.MultiThreadedMessageLoop, Is.True);
+1 -1
View File
@@ -3,6 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
+1 -1
View File
@@ -76,7 +76,7 @@ namespace CefSharp.WpfExample
else
{
browser.Load(urlTextBox.Text);
}
}
}
private void urlTextBox_KeyDown(object sender, KeyEventArgs e)
@@ -4,7 +4,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CefSharp.WpfExample")]
@@ -16,12 +16,12 @@ using System.Windows;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
@@ -33,10 +33,10 @@ using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
@@ -44,11 +44,11 @@ using System.Windows;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
+2 -2
View File
@@ -9,14 +9,14 @@ using namespace System;
using namespace System::IO;
using namespace System::Collections::Generic;
namespace CefSharp
namespace CefSharp
{
public ref class CEF sealed
{
private:
static bool _initialized = false;
static IDictionary<String^, Object^>^ _boundObjects;
static CEF()
{
_boundObjects = gcnew Dictionary<String^, Object^>();
+4 -4
View File
@@ -9,7 +9,7 @@
#include "IAfterResponse.h"
#include "StreamAdapter.h"
namespace CefSharp
namespace CefSharp
{
bool ClientAdapter::OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, const CefString& url, CefRefPtr<CefClient>& client, CefBrowserSettings& settings)
{
@@ -98,7 +98,7 @@ namespace CefSharp
AutoLock lock_scope(this);
if (frame->IsMain())
{
_browserControl->SetNavState(false, browser->CanGoBack(), browser->CanGoForward());
_browserControl->SetNavState(false, browser->CanGoBack(), browser->CanGoForward());
}
_browserControl->FrameLoadComplete(frame);
@@ -111,7 +111,7 @@ namespace CefSharp
{
CefRequestWrapper^ wrapper = gcnew CefRequestWrapper(request);
RequestResponse^ requestResponse = gcnew RequestResponse(wrapper);
handler->HandleBeforeResourceLoad(_browserControl, requestResponse);
if(requestResponse->Action == ResponseAction::Respond)
@@ -131,7 +131,7 @@ namespace CefSharp
}
}
return false;
return false;
}
void ClientAdapter::OnResourceResponse(CefRefPtr<CefBrowser> browser, const CefString& url, CefRefPtr<CefResponse> response, CefRefPtr<CefContentFilter>& filter)
+1 -1
View File
@@ -1,7 +1,7 @@
#include "stdafx.h"
#pragma once
namespace CefSharp
namespace CefSharp
{
using namespace System;
+1 -1
View File
@@ -12,7 +12,7 @@ public ref class ConsoleMessageEventArgs : EventArgs
String^ _message;
String^ _source;
int _line;
public:
ConsoleMessageEventArgs(String^ message, String^ source, int line)
: _message(message), _source(source), _line(line) {}
+1 -1
View File
@@ -3,7 +3,7 @@
using namespace System;
namespace CefSharp
namespace CefSharp
{
public interface class IAfterResponse
{
+1 -1
View File
@@ -3,7 +3,7 @@
using namespace System;
namespace CefSharp
namespace CefSharp
{
public interface class IBeforeMenu
{
+1 -1
View File
@@ -3,7 +3,7 @@
using namespace System;
namespace CefSharp
namespace CefSharp
{
public interface class IBeforePopup
{
+2 -2
View File
@@ -8,12 +8,12 @@
using namespace System;
using namespace System::IO;
namespace CefSharp
namespace CefSharp
{
public interface class IBeforeResourceLoad
{
public:
/// called before all resource loads.
/// allows the Request to be manipulated or an alternate response to be provided
void HandleBeforeResourceLoad(IWebBrowser^ browserControl, IRequestResponse^ requestResponse);
+1 -1
View File
@@ -4,7 +4,7 @@
using namespace System;
using namespace System::ComponentModel;
namespace CefSharp
namespace CefSharp
{
interface class IBeforePopup;
interface class IBeforeResourceLoad;
+13 -13
View File
@@ -8,7 +8,7 @@ public:
MCefRefPtr() : _ptr(NULL) {}
MCefRefPtr(T* p) : _ptr(p)
MCefRefPtr(T* p) : _ptr(p)
{
if (_ptr)
{
@@ -16,7 +16,7 @@ public:
}
}
MCefRefPtr(const MCefRefPtr<T>% r) : _ptr(r._ptr)
MCefRefPtr(const MCefRefPtr<T>% r) : _ptr(r._ptr)
{
if (_ptr)
{
@@ -24,7 +24,7 @@ public:
}
}
MCefRefPtr(const CefRefPtr<T>& r) : _ptr(r.get())
MCefRefPtr(const CefRefPtr<T>& r) : _ptr(r.get())
{
if (_ptr)
{
@@ -32,7 +32,7 @@ public:
}
}
~MCefRefPtr()
~MCefRefPtr()
{
if (_ptr)
{
@@ -48,11 +48,11 @@ public:
}
}
T* get()
{
return _ptr;
T* get()
{
return _ptr;
}
/*
operator T*() // commented out for now as this operator interferes with the return statement of MCefRefPtr<T>% operator=(T* p)
{
@@ -62,10 +62,10 @@ public:
T* operator->()
{
return _ptr;
return _ptr;
}
MCefRefPtr<T>% operator=(T* p)
MCefRefPtr<T>% operator=(T* p)
{
// AddRef first so that self assignment should work
if (p)
@@ -80,19 +80,19 @@ public:
return *this;
}
MCefRefPtr<T>% operator=(const MCefRefPtr<T>% r)
MCefRefPtr<T>% operator=(const MCefRefPtr<T>% r)
{
return %this = r._ptr;
}
void swap(T** pp)
void swap(T** pp)
{
T* p = _ptr;
_ptr = *pp;
*pp = p;
}
void swap(MCefRefPtr<T>% r)
void swap(MCefRefPtr<T>% r)
{
swap(%r._ptr);
}
+2 -2
View File
@@ -3,7 +3,7 @@
#include "ClientAdapter.h"
namespace CefSharp
namespace CefSharp
{
using namespace System;
@@ -37,4 +37,4 @@ namespace CefSharp
IMPLEMENT_LOCKING(OffscreenClientAdapter);
IMPLEMENT_REFCOUNTING(OffscreenClientAdapter);
};
}
}
+8 -8
View File
@@ -5,24 +5,24 @@
namespace CefSharp
{
String^ CefRequestWrapper::Url::get()
String^ CefRequestWrapper::Url::get()
{
return toClr(_wrappedRequest->GetURL());
}
void CefRequestWrapper::Url::set(String^ url)
{
if(url == nullptr)
if(url == nullptr)
{
throw gcnew System::ArgumentException("cannot be null", "url");
}
CefString str = toNative(url);
_wrappedRequest->SetURL(str);
}
String^ CefRequestWrapper::Method::get()
{
String^ CefRequestWrapper::Method::get()
{
return toClr(_wrappedRequest->GetMethod());
}
@@ -42,13 +42,13 @@ namespace CefSharp
return headers;
}
void CefRequestWrapper::SetHeaders(IDictionary<String^, String^>^ headers)
{
CefRequest::HeaderMap hm;
for each(KeyValuePair<String^, String^>^ pair in headers)
for each(KeyValuePair<String^, String^>^ pair in headers)
{
CefString name = toNative(pair->Key);
CefString value = toNative(pair->Value);
+1 -1
View File
@@ -22,7 +22,7 @@ namespace CefSharp
CefRequestWrapper(CefRefPtr<CefRequest> cefRequest) : _wrappedRequest(cefRequest) {}
public:
virtual property String^ Url { String^ get(); void set(String^ url); }
virtual property String^ Url { String^ get(); void set(String^ url); }
virtual property String^ Method { String^ get(); }
virtual IDictionary<String^, String^>^ GetHeaders();
virtual void SetHeaders(IDictionary<String^, String^>^ headers);
+1 -1
View File
@@ -7,7 +7,7 @@ namespace CefSharp
{
_action = ResponseAction::Cancel;
}
void RequestResponse::Redirect(String^ url)
{
_redirectUrl = url;
+3 -3
View File
@@ -12,7 +12,7 @@ namespace CefSharp
public interface class IRequestResponse
{
/// cancel the request, return nothing
void Cancel();
void Cancel();
/// the current request
property IRequest^ Request { IRequest^ get(); };
/// respond with redirection to the provided URL
@@ -32,12 +32,12 @@ namespace CefSharp
IRequest^ _request;
Stream^ _responseStream;
String^ _mimeType;
String^ _redirectUrl;
String^ _redirectUrl;
ResponseAction _action;
internal:
RequestResponse(IRequest^ request) :
RequestResponse(IRequest^ request) :
_action(ResponseAction::Continue),
_request(request) {}
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
namespace CefSharp
namespace CefSharp
{
public enum class ReturnValue
{
+5 -5
View File
@@ -5,7 +5,7 @@
using namespace System;
using namespace System::Threading;
namespace CefSharp
namespace CefSharp
{
///<summary>Return-To-Zero latch, signals whenever count is zero</summary>
@@ -15,17 +15,17 @@ namespace CefSharp
initonly ManualResetEvent^ _event;
int _currentCount;
bool _disposed;
public:
RtzCountdownEvent() :
_event(gcnew ManualResetEvent(true)),
_currentCount(0),
_currentCount(0),
_disposed(false) {}
!RtzCountdownEvent()
{
if(_disposed)
if(_disposed)
{
_disposed = true;
//_event->Dispose();
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CefSharp
bool handled = false;
Stream^ stream;
String^ mimeType;
AutoLock lock_scope(this);
IRequest^ requestWrapper = gcnew CefRequestWrapper(request);
+3 -3
View File
@@ -33,7 +33,7 @@ class SchemeHandlerWrapper : public CefSchemeHandler
public:
SchemeHandlerWrapper(ISchemeHandler^ handler) : _handler(handler)
SchemeHandlerWrapper(ISchemeHandler^ handler) : _handler(handler)
{
if(!_handler)
{
@@ -53,9 +53,9 @@ public:
class SchemeHandlerFactoryWrapper : public CefSchemeHandlerFactory
{
gcroot<ISchemeHandlerFactory^> _factory;
public:
SchemeHandlerFactoryWrapper(ISchemeHandlerFactory^ factory)
SchemeHandlerFactoryWrapper(ISchemeHandlerFactory^ factory)
: _factory(factory) {}
virtual CefRefPtr<CefSchemeHandler> Create(CefRefPtr<CefBrowser> browser, const CefString& scheme_name, CefRefPtr<CefRequest> request);
+2 -2
View File
@@ -9,9 +9,9 @@ namespace CefSharp
: Exception()
{}
public: ScriptException(String^ message)
public: ScriptException(String^ message)
: Exception(message)
{}
};
}
}
+34 -24
View File
@@ -3,8 +3,18 @@
using namespace System;
namespace CefSharp
namespace CefSharp
{
public enum class LogSeverity : int
{
Verbose = LOGSEVERITY_VERBOSE,
Info = LOGSEVERITY_INFO,
Warning = LOGSEVERITY_WARNING,
Error = LOGSEVERITY_ERROR,
ErrorReport = LOGSEVERITY_ERROR_REPORT,
Disable = LOGSEVERITY_DISABLE // Disables logging completely.
};
public ref class Settings
{
internal:
@@ -33,17 +43,17 @@ namespace CefSharp
MultiThreadedMessageLoop = true;
}
!Settings() { delete _cefSettings; }
!Settings() { delete _cefSettings; }
~Settings() { delete _cefSettings; }
property String^ CachePath
{
String^ get()
{
return toClr(_cefSettings->cache_path);
String^ get()
{
return toClr(_cefSettings->cache_path);
}
void set(String^ path)
void set(String^ path)
{
assignFromString(_cefSettings->cache_path, path);
}
@@ -51,12 +61,12 @@ namespace CefSharp
property String^ UserAgent
{
String^ get()
{
return toClr(_cefSettings->user_agent);
String^ get()
{
return toClr(_cefSettings->user_agent);
}
void set(String^ userAgent)
void set(String^ userAgent)
{
assignFromString(_cefSettings->user_agent, userAgent);
}
@@ -64,12 +74,12 @@ namespace CefSharp
property String^ ProductVersion
{
String^ get()
{
return toClr(_cefSettings->product_version);
String^ get()
{
return toClr(_cefSettings->product_version);
}
void set(String^ productVersion)
void set(String^ productVersion)
{
assignFromString(_cefSettings->product_version, productVersion);
}
@@ -77,12 +87,12 @@ namespace CefSharp
property String^ Locale
{
String^ get()
{
return toClr(_cefSettings->locale);
String^ get()
{
return toClr(_cefSettings->locale);
}
void set(String^ locale)
void set(String^ locale)
{
assignFromString(_cefSettings->locale, locale);
}
@@ -112,18 +122,18 @@ namespace CefSharp
}
}
property int LogSeverity
property CefSharp::LogSeverity LogSeverity
{
int get()
CefSharp::LogSeverity get()
{
return _cefSettings->log_severity;
return static_cast<CefSharp::LogSeverity>(_cefSettings->log_severity);
}
void set(int log_severity)
void set(CefSharp::LogSeverity log_severity)
{
_cefSettings->log_severity = (cef_log_severity_t)log_severity;
_cefSettings->log_severity = static_cast<cef_log_severity_t>(log_severity);
}
}
};
}
}
+7 -7
View File
@@ -17,14 +17,14 @@ namespace CefSharp
int ret = _stream->Read(buffer, 0, n);
pin_ptr<Byte> src = &buffer[0];
memcpy(ptr, static_cast<void*>(src), ret);
return ret / size;
}
return ret / size;
}
catch(Exception^)
{
return -1;
}
}
int StreamAdapter::Seek(long offset, int whence)
{
SeekOrigin seekOrigin;
@@ -36,17 +36,17 @@ namespace CefSharp
case SEEK_END:
seekOrigin = SeekOrigin::End;
break;
case SEEK_SET:
case SEEK_SET:
seekOrigin = SeekOrigin::Begin;
break;
default:
return -1;
}
try
try
{
_stream->Seek(offset, seekOrigin);
}
}
catch (Exception^)
{
return -1;
@@ -54,7 +54,7 @@ namespace CefSharp
return 0;
}
long StreamAdapter::Tell()
{
return static_cast<long>(_stream->Position);
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CefSharp
virtual ~StreamAdapter();
StreamAdapter(Stream^ stream) : _stream(stream) { }
virtual size_t Read(void* ptr, size_t size, size_t n);
virtual size_t Read(void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Eof();
+6 -6
View File
@@ -9,7 +9,7 @@ namespace CefSharp
{
return gcnew String(cefStr.str);
}
String^ toClr(const CefString& cefStr)
{
return gcnew String(cefStr.c_str());
@@ -132,7 +132,7 @@ namespace CefSharp
if (type->IsValueType && !type->IsPrimitive && !type->IsEnum)
{
CefRefPtr<CefV8Value> cefArray = CefV8Value::CreateArray();
cli::array<System::Reflection::FieldInfo^>^ fields = type->GetFields();
for (int i = 0; i < fields->Length; i++)
@@ -172,7 +172,7 @@ namespace CefSharp
{
return nullptr;
}
if (obj->IsBool())
return gcnew System::Boolean(obj->GetBoolValue());
if (obj->IsInt())
@@ -191,7 +191,7 @@ namespace CefSharp
std::vector<CefString> keys;
if (obj->GetKeys(keys))
{
Dictionary<String^, Object^>^ result = gcnew Dictionary<String^, Object^>();
Dictionary<String^, Object^>^ result = gcnew Dictionary<String^, Object^>();
for (int i = 0; i < arrLength; i++)
{
@@ -227,7 +227,7 @@ namespace CefSharp
int objLength = keys.size();
if (objLength > 0)
{
Dictionary<String^, Object^>^ result = gcnew Dictionary<String^, Object^>();
Dictionary<String^, Object^>^ result = gcnew Dictionary<String^, Object^>();
for (int i = 0; i < objLength; i++)
{
@@ -251,7 +251,7 @@ namespace CefSharp
return result;
}
}
return nullptr;
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CefSharp
String^ toClr(const CefString& cefStr);
CefString toNative(String^ str);
void assignFromString(cef_string_t& cefStrT, String^ str);
CefRefPtr<CefV8Value> convertToCef(Object^ obj, Type^ type);
Object^ convertFromCef(CefRefPtr<CefV8Value> obj);
}
+1 -1
View File
@@ -13,7 +13,7 @@
// distribution.
//
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the name CefSharp nor the names of its contributors
// Framework nor the name CefSharp nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
+2 -2
View File
@@ -34,7 +34,7 @@ _UPDATE_ : bounced zip to 0.3.1 to fix a build issue, now includes Debug and Rel
- Fixes including resize issues and incorrect address events.
- New unit tests and examples.
2010/12/03 - 0.1 Released
2010/12/03 - 0.1 Released
-------------------------
- [Download 0.1 here](https://github.com/downloads/chillitom/CefSharp/CefSharp-0.1.7z "src, bins and examples")
- BrowserControl user control
@@ -44,7 +44,7 @@ _UPDATE_ : bounced zip to 0.3.1 to fix a build issue, now includes Debug and Rel
- Interception of resource loading, loads from System.IO.Stream
Enough to build a poor man's web browser and call a bit of JavaScript. Coming soon, more features including the ability to bind .Net object straight into the browser's V8 JavaScript context.