diff --git a/CefSharp.WinForms/WebBrowser.cpp b/CefSharp.WinForms/WebBrowser.cpp index d50a13c99..879bcb913 100644 --- a/CefSharp.WinForms/WebBrowser.cpp +++ b/CefSharp.WinForms/WebBrowser.cpp @@ -84,8 +84,7 @@ namespace CefSharp void WebBrowser::Back() { WaitForInitialized(); - _clientAdapter->GetCefBrowser()->StopLoad(); - + _clientAdapter->GetCefBrowser()->GoBack(); } void WebBrowser::Forward() diff --git a/CefSharp.WinFormsExample/AboutBox.Designer.cs b/CefSharp.WinFormsExample/AboutBox.Designer.cs index a71078932..920bb64be 100644 --- a/CefSharp.WinFormsExample/AboutBox.Designer.cs +++ b/CefSharp.WinFormsExample/AboutBox.Designer.cs @@ -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; diff --git a/CefSharp.WinFormsExample/AboutBox.cs b/CefSharp.WinFormsExample/AboutBox.cs index a594dfa08..922213287 100644 --- a/CefSharp.WinFormsExample/AboutBox.cs +++ b/CefSharp.WinFormsExample/AboutBox.cs @@ -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"; } diff --git a/CefSharp.WinFormsExample/Browser.cs b/CefSharp.WinFormsExample/Browser.cs index 40452fccd..5a9422b37 100644 --- a/CefSharp.WinFormsExample/Browser.cs +++ b/CefSharp.WinFormsExample/Browser.cs @@ -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')"); } diff --git a/CefSharp.WinFormsExample/InputForm.Designer.cs b/CefSharp.WinFormsExample/InputForm.Designer.cs index 51372cf51..ba72a1162 100644 --- a/CefSharp.WinFormsExample/InputForm.Designer.cs +++ b/CefSharp.WinFormsExample/InputForm.Designer.cs @@ -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); diff --git a/CefSharp.WinFormsExample/Properties/AssemblyInfo.cs b/CefSharp.WinFormsExample/Properties/AssemblyInfo.cs index 57f81587a..15074ebc1 100644 --- a/CefSharp.WinFormsExample/Properties/AssemblyInfo.cs +++ b/CefSharp.WinFormsExample/Properties/AssemblyInfo.cs @@ -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")] diff --git a/CefSharp.WinFormsExample/Properties/Resources.Designer.cs b/CefSharp.WinFormsExample/Properties/Resources.Designer.cs index fad40c11f..5db27e726 100644 --- a/CefSharp.WinFormsExample/Properties/Resources.Designer.cs +++ b/CefSharp.WinFormsExample/Properties/Resources.Designer.cs @@ -10,8 +10,8 @@ namespace CefSharp.Example.Properties { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -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() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace CefSharp.Example.Properties { return resourceMan; } } - + /// /// 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; } } - + /// /// Looks up a localized string similar to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ///<html> @@ -68,11 +68,11 @@ namespace CefSharp.Example.Properties { /// </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"); /// } @@ -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)); } } - + /// /// Looks up a localized string similar to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ///<html> @@ -139,7 +139,7 @@ namespace CefSharp.Example.Properties { return ResourceManager.GetString("PopupTest", resourceCulture); } } - + /// /// Looks up a localized string similar to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ///<html> @@ -157,7 +157,7 @@ namespace CefSharp.Example.Properties { return ResourceManager.GetString("SchemeTest", resourceCulture); } } - + /// /// Looks up a localized string similar to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ///<html> diff --git a/CefSharp.WinFormsExample/Resources/BindingTest.html b/CefSharp.WinFormsExample/Resources/BindingTest.html index 40a058e1c..92f5ade6f 100644 --- a/CefSharp.WinFormsExample/Resources/BindingTest.html +++ b/CefSharp.WinFormsExample/Resources/BindingTest.html @@ -5,28 +5,28 @@

- Result of calling bound.Repeat("hi ", 5) = + Result of calling bound.Repeat("hi ", 5) =

- + Methods on bound object 'bound':
    -
+ + \ No newline at end of file diff --git a/CefSharp.WinFormsExample/TestSettings.cs b/CefSharp.WinFormsExample/TestSettings.cs index 620914f03..e6a98303e 100644 --- a/CefSharp.WinFormsExample/TestSettings.cs +++ b/CefSharp.WinFormsExample/TestSettings.cs @@ -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); diff --git a/CefSharp.WpfExample/App.xaml b/CefSharp.WpfExample/App.xaml index ad90953ac..28124934a 100644 --- a/CefSharp.WpfExample/App.xaml +++ b/CefSharp.WpfExample/App.xaml @@ -3,6 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> - + diff --git a/CefSharp.WpfExample/MainWindow.xaml.cs b/CefSharp.WpfExample/MainWindow.xaml.cs index a1d959461..945b6c99c 100644 --- a/CefSharp.WpfExample/MainWindow.xaml.cs +++ b/CefSharp.WpfExample/MainWindow.xaml.cs @@ -76,7 +76,7 @@ namespace CefSharp.WpfExample else { browser.Load(urlTextBox.Text); - } + } } private void urlTextBox_KeyDown(object sender, KeyEventArgs e) diff --git a/CefSharp.WpfExample/Properties/AssemblyInfo.cs b/CefSharp.WpfExample/Properties/AssemblyInfo.cs index d717136b5..9318db749 100644 --- a/CefSharp.WpfExample/Properties/AssemblyInfo.cs +++ b/CefSharp.WpfExample/Properties/AssemblyInfo.cs @@ -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 //CultureYouAreCodingWith in your .csproj file //inside a . For example, if you are using US english //in your source files, set the 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")] diff --git a/CefSharp/CefSharp.h b/CefSharp/CefSharp.h index 3cb1cca16..ab92059bd 100644 --- a/CefSharp/CefSharp.h +++ b/CefSharp/CefSharp.h @@ -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^ _boundObjects; - + static CEF() { _boundObjects = gcnew Dictionary(); diff --git a/CefSharp/ClientAdapter.cpp b/CefSharp/ClientAdapter.cpp index 918f85113..671af8c68 100644 --- a/CefSharp/ClientAdapter.cpp +++ b/CefSharp/ClientAdapter.cpp @@ -9,7 +9,7 @@ #include "IAfterResponse.h" #include "StreamAdapter.h" -namespace CefSharp +namespace CefSharp { bool ClientAdapter::OnBeforePopup(CefRefPtr parentBrowser, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, const CefString& url, CefRefPtr& 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 browser, const CefString& url, CefRefPtr response, CefRefPtr& filter) diff --git a/CefSharp/ClientAdapter.h b/CefSharp/ClientAdapter.h index e6313a52a..49ac7258b 100644 --- a/CefSharp/ClientAdapter.h +++ b/CefSharp/ClientAdapter.h @@ -1,7 +1,7 @@ #include "stdafx.h" #pragma once -namespace CefSharp +namespace CefSharp { using namespace System; diff --git a/CefSharp/ConsoleMessageEventArgs.h b/CefSharp/ConsoleMessageEventArgs.h index 4ddba8293..178cc6a7d 100644 --- a/CefSharp/ConsoleMessageEventArgs.h +++ b/CefSharp/ConsoleMessageEventArgs.h @@ -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) {} diff --git a/CefSharp/IAfterResponse.h b/CefSharp/IAfterResponse.h index ff054dddd..436c92047 100644 --- a/CefSharp/IAfterResponse.h +++ b/CefSharp/IAfterResponse.h @@ -3,7 +3,7 @@ using namespace System; -namespace CefSharp +namespace CefSharp { public interface class IAfterResponse { diff --git a/CefSharp/IBeforeMenu.h b/CefSharp/IBeforeMenu.h index 4124fba16..2a77a210c 100644 --- a/CefSharp/IBeforeMenu.h +++ b/CefSharp/IBeforeMenu.h @@ -3,7 +3,7 @@ using namespace System; -namespace CefSharp +namespace CefSharp { public interface class IBeforeMenu { diff --git a/CefSharp/IBeforePopup.h b/CefSharp/IBeforePopup.h index e4c867aef..58e264ef4 100644 --- a/CefSharp/IBeforePopup.h +++ b/CefSharp/IBeforePopup.h @@ -3,7 +3,7 @@ using namespace System; -namespace CefSharp +namespace CefSharp { public interface class IBeforePopup { diff --git a/CefSharp/IBeforeResourceLoad.h b/CefSharp/IBeforeResourceLoad.h index d8a3da56b..99ece4580 100644 --- a/CefSharp/IBeforeResourceLoad.h +++ b/CefSharp/IBeforeResourceLoad.h @@ -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); diff --git a/CefSharp/IWebBrowser.h b/CefSharp/IWebBrowser.h index 24159de85..5d34b5e8d 100644 --- a/CefSharp/IWebBrowser.h +++ b/CefSharp/IWebBrowser.h @@ -4,7 +4,7 @@ using namespace System; using namespace System::ComponentModel; -namespace CefSharp +namespace CefSharp { interface class IBeforePopup; interface class IBeforeResourceLoad; diff --git a/CefSharp/ManagedCefRefPtr.h b/CefSharp/ManagedCefRefPtr.h index 0227a72f5..c42d49945 100644 --- a/CefSharp/ManagedCefRefPtr.h +++ b/CefSharp/ManagedCefRefPtr.h @@ -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% r) : _ptr(r._ptr) + MCefRefPtr(const MCefRefPtr% r) : _ptr(r._ptr) { if (_ptr) { @@ -24,7 +24,7 @@ public: } } - MCefRefPtr(const CefRefPtr& r) : _ptr(r.get()) + MCefRefPtr(const CefRefPtr& 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% operator=(T* p) { @@ -62,10 +62,10 @@ public: T* operator->() { - return _ptr; + return _ptr; } - MCefRefPtr% operator=(T* p) + MCefRefPtr% operator=(T* p) { // AddRef first so that self assignment should work if (p) @@ -80,19 +80,19 @@ public: return *this; } - MCefRefPtr% operator=(const MCefRefPtr% r) + MCefRefPtr% operator=(const MCefRefPtr% r) { return %this = r._ptr; } - void swap(T** pp) + void swap(T** pp) { T* p = _ptr; _ptr = *pp; *pp = p; } - void swap(MCefRefPtr% r) + void swap(MCefRefPtr% r) { swap(%r._ptr); } diff --git a/CefSharp/OffscreenClientAdapter.h b/CefSharp/OffscreenClientAdapter.h index 748064862..7015ae22c 100644 --- a/CefSharp/OffscreenClientAdapter.h +++ b/CefSharp/OffscreenClientAdapter.h @@ -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); }; -} \ No newline at end of file +} diff --git a/CefSharp/Request.cpp b/CefSharp/Request.cpp index 0487ba1cc..eeeaee326 100644 --- a/CefSharp/Request.cpp +++ b/CefSharp/Request.cpp @@ -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^ headers) { CefRequest::HeaderMap hm; - for each(KeyValuePair^ pair in headers) + for each(KeyValuePair^ pair in headers) { CefString name = toNative(pair->Key); CefString value = toNative(pair->Value); diff --git a/CefSharp/Request.h b/CefSharp/Request.h index 5b3c51fbf..c9f2aef50 100644 --- a/CefSharp/Request.h +++ b/CefSharp/Request.h @@ -22,7 +22,7 @@ namespace CefSharp CefRequestWrapper(CefRefPtr 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^ GetHeaders(); virtual void SetHeaders(IDictionary^ headers); diff --git a/CefSharp/RequestResponse.cpp b/CefSharp/RequestResponse.cpp index 3bd278332..d2b8f3b71 100644 --- a/CefSharp/RequestResponse.cpp +++ b/CefSharp/RequestResponse.cpp @@ -7,7 +7,7 @@ namespace CefSharp { _action = ResponseAction::Cancel; } - + void RequestResponse::Redirect(String^ url) { _redirectUrl = url; diff --git a/CefSharp/RequestResponse.h b/CefSharp/RequestResponse.h index 49d6c55b8..057471140 100644 --- a/CefSharp/RequestResponse.h +++ b/CefSharp/RequestResponse.h @@ -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) {} diff --git a/CefSharp/ReturnValue.h b/CefSharp/ReturnValue.h index 45b1b446c..ca7c6d728 100644 --- a/CefSharp/ReturnValue.h +++ b/CefSharp/ReturnValue.h @@ -1,6 +1,6 @@ #pragma once -namespace CefSharp +namespace CefSharp { public enum class ReturnValue { diff --git a/CefSharp/RtzCountdownEvent.h b/CefSharp/RtzCountdownEvent.h index bdabba5c6..67734dd7f 100644 --- a/CefSharp/RtzCountdownEvent.h +++ b/CefSharp/RtzCountdownEvent.h @@ -5,7 +5,7 @@ using namespace System; using namespace System::Threading; -namespace CefSharp +namespace CefSharp { ///Return-To-Zero latch, signals whenever count is zero @@ -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(); diff --git a/CefSharp/SchemeHandler.cpp b/CefSharp/SchemeHandler.cpp index b2e46bfe4..16273fed4 100644 --- a/CefSharp/SchemeHandler.cpp +++ b/CefSharp/SchemeHandler.cpp @@ -16,7 +16,7 @@ namespace CefSharp bool handled = false; Stream^ stream; String^ mimeType; - + AutoLock lock_scope(this); IRequest^ requestWrapper = gcnew CefRequestWrapper(request); diff --git a/CefSharp/SchemeHandler.h b/CefSharp/SchemeHandler.h index 1f59970f7..726ad233a 100644 --- a/CefSharp/SchemeHandler.h +++ b/CefSharp/SchemeHandler.h @@ -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 _factory; - + public: - SchemeHandlerFactoryWrapper(ISchemeHandlerFactory^ factory) + SchemeHandlerFactoryWrapper(ISchemeHandlerFactory^ factory) : _factory(factory) {} virtual CefRefPtr Create(CefRefPtr browser, const CefString& scheme_name, CefRefPtr request); diff --git a/CefSharp/ScriptException.h b/CefSharp/ScriptException.h index b1c009ce7..df1a302d9 100644 --- a/CefSharp/ScriptException.h +++ b/CefSharp/ScriptException.h @@ -9,9 +9,9 @@ namespace CefSharp : Exception() {} - public: ScriptException(String^ message) + public: ScriptException(String^ message) : Exception(message) {} }; -} \ No newline at end of file +} diff --git a/CefSharp/Settings.h b/CefSharp/Settings.h index f6960eefe..3fb0a647c 100644 --- a/CefSharp/Settings.h +++ b/CefSharp/Settings.h @@ -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(_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(log_severity); } } }; -} \ No newline at end of file +} diff --git a/CefSharp/StreamAdapter.cpp b/CefSharp/StreamAdapter.cpp index 7d81d73d0..265ff301c 100644 --- a/CefSharp/StreamAdapter.cpp +++ b/CefSharp/StreamAdapter.cpp @@ -17,14 +17,14 @@ namespace CefSharp int ret = _stream->Read(buffer, 0, n); pin_ptr src = &buffer[0]; memcpy(ptr, static_cast(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(_stream->Position); diff --git a/CefSharp/StreamAdapter.h b/CefSharp/StreamAdapter.h index 57cbd5d3f..653a39ece 100644 --- a/CefSharp/StreamAdapter.h +++ b/CefSharp/StreamAdapter.h @@ -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(); diff --git a/CefSharp/Utils.cpp b/CefSharp/Utils.cpp index 05bf484b8..9bec17a3b 100644 --- a/CefSharp/Utils.cpp +++ b/CefSharp/Utils.cpp @@ -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 cefArray = CefV8Value::CreateArray(); - + cli::array^ 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 keys; if (obj->GetKeys(keys)) { - Dictionary^ result = gcnew Dictionary(); + Dictionary^ result = gcnew Dictionary(); for (int i = 0; i < arrLength; i++) { @@ -227,7 +227,7 @@ namespace CefSharp int objLength = keys.size(); if (objLength > 0) { - Dictionary^ result = gcnew Dictionary(); + Dictionary^ result = gcnew Dictionary(); for (int i = 0; i < objLength; i++) { @@ -251,7 +251,7 @@ namespace CefSharp return result; } } - + return nullptr; } diff --git a/CefSharp/Utils.h b/CefSharp/Utils.h index b07049746..fc61970d6 100644 --- a/CefSharp/Utils.h +++ b/CefSharp/Utils.h @@ -9,7 +9,7 @@ namespace CefSharp String^ toClr(const CefString& cefStr); CefString toNative(String^ str); void assignFromString(cef_string_t& cefStrT, String^ str); - + CefRefPtr convertToCef(Object^ obj, Type^ type); Object^ convertFromCef(CefRefPtr obj); } \ No newline at end of file diff --git a/LICENSE b/LICENSE index f19afe350..f713abe63 100644 --- a/LICENSE +++ b/LICENSE @@ -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. // diff --git a/README.markdown b/README.markdown index 7c0dfda38..aee1eb278 100644 --- a/README.markdown +++ b/README.markdown @@ -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. - +