Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Recommit files with the line-endings Git wants

After a fresh clone, Git thought all the files in this commit had
incorrect line-endings. So all I've done is commit the changes that Git
already thought were present.
  • Loading branch information...
commit b340e3221b88fa8becac6d4b86d292586d325317 1 parent cf21c2b
@aroben aroben authored
View
362 CefSharp/ClientAdapter.cpp
@@ -1,182 +1,182 @@
-#include "stdafx.h"
-
-#include "BindingHandler.h"
-#include "ClientAdapter.h"
-#include "CefSharp.h"
-#include "IBeforePopup.h"
-#include "IBeforeResourceLoad.h"
-#include "IBeforeMenu.h"
-#include "IAfterResponse.h"
-#include "StreamAdapter.h"
-
-namespace CefSharp
-{
- bool ClientAdapter::OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, const CefString& url, CefRefPtr<CefClient>& client, CefBrowserSettings& settings)
- {
- IBeforePopup^ handler = _browserControl->BeforePopupHandler;
- return handler != nullptr &&
- handler->HandleBeforePopup(toClr(url), windowInfo.m_x, windowInfo.m_y, windowInfo.m_nWidth, windowInfo.m_nHeight);
- }
-
- bool ClientAdapter::OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, NavType navType, bool isRedirect)
- {
- // NAVTYPE_OTHER is issued whenever we explicitly force the navigation via a method
- if (!_browserControl->ShouldOpenLinksInExternalBrowser || navType == NAVTYPE_OTHER)
- {
- return false;
- }
-
- String^ s;
- s = toClr(request->GetURL());
- if (s->ToLowerInvariant()->StartsWith("http"))
- {
- System::Diagnostics::Process::Start(s);
- }
-
- return true;
- }
-
- void ClientAdapter::OnAfterCreated(CefRefPtr<CefBrowser> browser)
- {
- if(!browser->IsPopup())
- {
- _browserHwnd = browser->GetWindowHandle();
- _cefBrowser = browser;
-
- _browserControl->OnInitialized();
- }
- }
-
- void ClientAdapter::OnBeforeClose(CefRefPtr<CefBrowser> browser)
- {
- if (_browserHwnd == browser->GetWindowHandle())
- {
- _cefBrowser = nullptr;
- }
- }
-
- void ClientAdapter::OnAddressChange(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& url)
- {
- if(frame->IsMain())
- {
- _browserControl->SetAddress(toClr(url));
- }
- }
-
- void ClientAdapter::OnTitleChange(CefRefPtr<CefBrowser> browser, const CefString& title)
- {
- _browserControl->SetTitle(toClr(title));
- }
-
- bool ClientAdapter::OnTooltip(CefRefPtr<CefBrowser> browser, CefString& text)
- {
- String^ str = toClr(text);
-
- if (str != _tooltip)
- {
- _tooltip = str;
- _browserControl->SetToolTip(_tooltip);
- }
-
- return true;
- }
-
- bool ClientAdapter::OnConsoleMessage(CefRefPtr<CefBrowser> browser, const CefString& message, const CefString& source, int line)
- {
- String^ messageStr = toClr(message);
- String^ sourceStr = toClr(source);
- _browserControl->RaiseConsoleMessage(messageStr, sourceStr, line);
-
- return true;
- }
-
- void ClientAdapter::OnLoadStart(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
- {
- if (browser->IsPopup())
- {
- return;
- }
-
- AutoLock lock_scope(this);
- if (frame->IsMain())
- {
- _browserControl->SetNavState(true, false, false);
- }
-
- _browserControl->AddFrame(frame);
- }
-
- void ClientAdapter::OnLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int httpStatusCode)
- {
- if(browser->IsPopup())
- {
- return;
- }
-
- AutoLock lock_scope(this);
- if (frame->IsMain())
- {
- _browserControl->SetNavState(false, browser->CanGoBack(), browser->CanGoForward());
- }
-
- _browserControl->FrameLoadComplete(frame);
- }
-
- bool ClientAdapter::OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser, CefRefPtr<CefRequest> request, CefString& redirectUrl, CefRefPtr<CefStreamReader>& resourceStream, CefRefPtr<CefResponse> response, int loadFlags)
- {
- IBeforeResourceLoad^ handler = _browserControl->BeforeResourceLoadHandler;
- if(handler != nullptr)
- {
- CefRequestWrapper^ wrapper = gcnew CefRequestWrapper(request);
- RequestResponse^ requestResponse = gcnew RequestResponse(wrapper);
-
- handler->HandleBeforeResourceLoad(_browserControl, requestResponse);
-
- if(requestResponse->Action == ResponseAction::Respond)
- {
- CefRefPtr<StreamAdapter> adapter = new StreamAdapter(requestResponse->ResponseStream);
- resourceStream = CefStreamReader::CreateForHandler(static_cast<CefRefPtr<CefReadHandler>>(adapter));
- response->SetMimeType(toNative(requestResponse->MimeType));
- return false;
- }
- else if(requestResponse->Action == ResponseAction::Cancel)
- {
- return true;
- }
- else if(requestResponse->Action == ResponseAction::Redirect)
- {
- redirectUrl = toNative(requestResponse->RedirectUrl);
- }
- }
-
- return false;
- }
-
- void ClientAdapter::OnResourceResponse(CefRefPtr<CefBrowser> browser, const CefString& url, CefRefPtr<CefResponse> response, CefRefPtr<CefContentFilter>& filter)
- {
- IAfterResponse^ handler = _browserControl->AfterResponseHandler;
- if (handler != nullptr)
- {
- String^ cookie = toClr(response->GetHeader("Set-Cookie"));
- if (!String::IsNullOrEmpty(cookie))
- {
- handler->HandleSetCookie(cookie);
- }
- }
- }
-
- void ClientAdapter::OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context)
- {
- for each(KeyValuePair<String^, Object^>^ kvp in CEF::GetBoundObjects())
- {
- BindingHandler::Bind(kvp->Key, kvp->Value, context->GetGlobal());
- }
- }
-
- bool ClientAdapter::OnBeforeMenu(CefRefPtr<CefBrowser> browser, const CefMenuInfo& menuInfo)
- {
- IBeforeMenu^ beforeMenuHandler = _browserControl->BeforeMenuHandler;
- return beforeMenuHandler != nullptr &&
- beforeMenuHandler->HandleBeforeMenu();
- }
+#include "stdafx.h"
+
+#include "BindingHandler.h"
+#include "ClientAdapter.h"
+#include "CefSharp.h"
+#include "IBeforePopup.h"
+#include "IBeforeResourceLoad.h"
+#include "IBeforeMenu.h"
+#include "IAfterResponse.h"
+#include "StreamAdapter.h"
+
+namespace CefSharp
+{
+ bool ClientAdapter::OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, const CefString& url, CefRefPtr<CefClient>& client, CefBrowserSettings& settings)
+ {
+ IBeforePopup^ handler = _browserControl->BeforePopupHandler;
+ return handler != nullptr &&
+ handler->HandleBeforePopup(toClr(url), windowInfo.m_x, windowInfo.m_y, windowInfo.m_nWidth, windowInfo.m_nHeight);
+ }
+
+ bool ClientAdapter::OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, NavType navType, bool isRedirect)
+ {
+ // NAVTYPE_OTHER is issued whenever we explicitly force the navigation via a method
+ if (!_browserControl->ShouldOpenLinksInExternalBrowser || navType == NAVTYPE_OTHER)
+ {
+ return false;
+ }
+
+ String^ s;
+ s = toClr(request->GetURL());
+ if (s->ToLowerInvariant()->StartsWith("http"))
+ {
+ System::Diagnostics::Process::Start(s);
+ }
+
+ return true;
+ }
+
+ void ClientAdapter::OnAfterCreated(CefRefPtr<CefBrowser> browser)
+ {
+ if(!browser->IsPopup())
+ {
+ _browserHwnd = browser->GetWindowHandle();
+ _cefBrowser = browser;
+
+ _browserControl->OnInitialized();
+ }
+ }
+
+ void ClientAdapter::OnBeforeClose(CefRefPtr<CefBrowser> browser)
+ {
+ if (_browserHwnd == browser->GetWindowHandle())
+ {
+ _cefBrowser = nullptr;
+ }
+ }
+
+ void ClientAdapter::OnAddressChange(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& url)
+ {
+ if(frame->IsMain())
+ {
+ _browserControl->SetAddress(toClr(url));
+ }
+ }
+
+ void ClientAdapter::OnTitleChange(CefRefPtr<CefBrowser> browser, const CefString& title)
+ {
+ _browserControl->SetTitle(toClr(title));
+ }
+
+ bool ClientAdapter::OnTooltip(CefRefPtr<CefBrowser> browser, CefString& text)
+ {
+ String^ str = toClr(text);
+
+ if (str != _tooltip)
+ {
+ _tooltip = str;
+ _browserControl->SetToolTip(_tooltip);
+ }
+
+ return true;
+ }
+
+ bool ClientAdapter::OnConsoleMessage(CefRefPtr<CefBrowser> browser, const CefString& message, const CefString& source, int line)
+ {
+ String^ messageStr = toClr(message);
+ String^ sourceStr = toClr(source);
+ _browserControl->RaiseConsoleMessage(messageStr, sourceStr, line);
+
+ return true;
+ }
+
+ void ClientAdapter::OnLoadStart(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
+ {
+ if (browser->IsPopup())
+ {
+ return;
+ }
+
+ AutoLock lock_scope(this);
+ if (frame->IsMain())
+ {
+ _browserControl->SetNavState(true, false, false);
+ }
+
+ _browserControl->AddFrame(frame);
+ }
+
+ void ClientAdapter::OnLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int httpStatusCode)
+ {
+ if(browser->IsPopup())
+ {
+ return;
+ }
+
+ AutoLock lock_scope(this);
+ if (frame->IsMain())
+ {
+ _browserControl->SetNavState(false, browser->CanGoBack(), browser->CanGoForward());
+ }
+
+ _browserControl->FrameLoadComplete(frame);
+ }
+
+ bool ClientAdapter::OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser, CefRefPtr<CefRequest> request, CefString& redirectUrl, CefRefPtr<CefStreamReader>& resourceStream, CefRefPtr<CefResponse> response, int loadFlags)
+ {
+ IBeforeResourceLoad^ handler = _browserControl->BeforeResourceLoadHandler;
+ if(handler != nullptr)
+ {
+ CefRequestWrapper^ wrapper = gcnew CefRequestWrapper(request);
+ RequestResponse^ requestResponse = gcnew RequestResponse(wrapper);
+
+ handler->HandleBeforeResourceLoad(_browserControl, requestResponse);
+
+ if(requestResponse->Action == ResponseAction::Respond)
+ {
+ CefRefPtr<StreamAdapter> adapter = new StreamAdapter(requestResponse->ResponseStream);
+ resourceStream = CefStreamReader::CreateForHandler(static_cast<CefRefPtr<CefReadHandler>>(adapter));
+ response->SetMimeType(toNative(requestResponse->MimeType));
+ return false;
+ }
+ else if(requestResponse->Action == ResponseAction::Cancel)
+ {
+ return true;
+ }
+ else if(requestResponse->Action == ResponseAction::Redirect)
+ {
+ redirectUrl = toNative(requestResponse->RedirectUrl);
+ }
+ }
+
+ return false;
+ }
+
+ void ClientAdapter::OnResourceResponse(CefRefPtr<CefBrowser> browser, const CefString& url, CefRefPtr<CefResponse> response, CefRefPtr<CefContentFilter>& filter)
+ {
+ IAfterResponse^ handler = _browserControl->AfterResponseHandler;
+ if (handler != nullptr)
+ {
+ String^ cookie = toClr(response->GetHeader("Set-Cookie"));
+ if (!String::IsNullOrEmpty(cookie))
+ {
+ handler->HandleSetCookie(cookie);
+ }
+ }
+ }
+
+ void ClientAdapter::OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context)
+ {
+ for each(KeyValuePair<String^, Object^>^ kvp in CEF::GetBoundObjects())
+ {
+ BindingHandler::Bind(kvp->Key, kvp->Value, context->GetGlobal());
+ }
+ }
+
+ bool ClientAdapter::OnBeforeMenu(CefRefPtr<CefBrowser> browser, const CefMenuInfo& menuInfo)
+ {
+ IBeforeMenu^ beforeMenuHandler = _browserControl->BeforeMenuHandler;
+ return beforeMenuHandler != nullptr &&
+ beforeMenuHandler->HandleBeforeMenu();
+ }
}
View
208 CefUsageTests/CefUsageTests.csproj
@@ -1,105 +1,105 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21022</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{E8A40E8F-5B1E-4021-BF60-7F7482235E81}</ProjectGuid>
- <OutputType>WinExe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>CefUsageTests</RootNamespace>
- <AssemblyName>CefUsageTests</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>3.5</OldToolsVersion>
- <UpgradeBackupLocation />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>x86</PlatformTarget>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.DataSetExtensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Deployment" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="MainForm.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="MainForm.Designer.cs">
- <DependentUpon>MainForm.cs</DependentUpon>
- </Compile>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <EmbeddedResource Include="MainForm.resx">
- <DependentUpon>MainForm.cs</DependentUpon>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <EmbeddedResource Include="Properties\Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <Compile Include="Properties\Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Resources.resx</DependentUpon>
- <DesignTime>True</DesignTime>
- </Compile>
- <None Include="app.config" />
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- <Compile Include="Properties\Settings.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Settings.settings</DependentUpon>
- <DesignTimeSharedInput>True</DesignTimeSharedInput>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\CefSharp\CefSharp.vcxproj">
- <Project>{7B495581-2271-4F41-9476-ACB86E8C864F}</Project>
- <Name>CefSharp</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{E8A40E8F-5B1E-4021-BF60-7F7482235E81}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CefUsageTests</RootNamespace>
+ <AssemblyName>CefUsageTests</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <UpgradeBackupLocation />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MainForm.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="MainForm.Designer.cs">
+ <DependentUpon>MainForm.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <EmbeddedResource Include="MainForm.resx">
+ <DependentUpon>MainForm.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ <DesignTime>True</DesignTime>
+ </Compile>
+ <None Include="app.config" />
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\CefSharp\CefSharp.vcxproj">
+ <Project>{7B495581-2271-4F41-9476-ACB86E8C864F}</Project>
+ <Name>CefSharp</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
</Project>
View
176 CefUsageTests/MainForm.Designer.cs
@@ -1,88 +1,88 @@
-namespace CefUsageTests
-{
- partial class MainForm
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.panel = new System.Windows.Forms.Panel();
- this.Test1Button = new System.Windows.Forms.Button();
- this.Test2Button = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // panel
- //
- this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.panel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.panel.Location = new System.Drawing.Point(12, 106);
- this.panel.Name = "panel";
- this.panel.Size = new System.Drawing.Size(556, 355);
- this.panel.TabIndex = 0;
- //
- // Test1Button
- //
- this.Test1Button.Location = new System.Drawing.Point(12, 12);
- this.Test1Button.Name = "Test1Button";
- this.Test1Button.Size = new System.Drawing.Size(75, 23);
- this.Test1Button.TabIndex = 1;
- this.Test1Button.Text = "Test1";
- this.Test1Button.UseVisualStyleBackColor = true;
- this.Test1Button.Click += new System.EventHandler(this.Test1Button_Click);
- //
- // Test2Button
- //
- this.Test2Button.Location = new System.Drawing.Point(93, 12);
- this.Test2Button.Name = "Test2Button";
- this.Test2Button.Size = new System.Drawing.Size(75, 23);
- this.Test2Button.TabIndex = 2;
- this.Test2Button.Text = "Test2";
- this.Test2Button.UseVisualStyleBackColor = true;
- this.Test2Button.Click += new System.EventHandler(this.Test2Button_Click);
- //
- // MainForm
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(580, 473);
- this.Controls.Add(this.Test2Button);
- this.Controls.Add(this.Test1Button);
- this.Controls.Add(this.panel);
- this.Name = "MainForm";
- this.Text = "Cef Usage Tests";
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.Panel panel;
- private System.Windows.Forms.Button Test1Button;
- private System.Windows.Forms.Button Test2Button;
- }
-}
-
+namespace CefUsageTests
+{
+ partial class MainForm
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel = new System.Windows.Forms.Panel();
+ this.Test1Button = new System.Windows.Forms.Button();
+ this.Test2Button = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // panel
+ //
+ this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.panel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+ this.panel.Location = new System.Drawing.Point(12, 106);
+ this.panel.Name = "panel";
+ this.panel.Size = new System.Drawing.Size(556, 355);
+ this.panel.TabIndex = 0;
+ //
+ // Test1Button
+ //
+ this.Test1Button.Location = new System.Drawing.Point(12, 12);
+ this.Test1Button.Name = "Test1Button";
+ this.Test1Button.Size = new System.Drawing.Size(75, 23);
+ this.Test1Button.TabIndex = 1;
+ this.Test1Button.Text = "Test1";
+ this.Test1Button.UseVisualStyleBackColor = true;
+ this.Test1Button.Click += new System.EventHandler(this.Test1Button_Click);
+ //
+ // Test2Button
+ //
+ this.Test2Button.Location = new System.Drawing.Point(93, 12);
+ this.Test2Button.Name = "Test2Button";
+ this.Test2Button.Size = new System.Drawing.Size(75, 23);
+ this.Test2Button.TabIndex = 2;
+ this.Test2Button.Text = "Test2";
+ this.Test2Button.UseVisualStyleBackColor = true;
+ this.Test2Button.Click += new System.EventHandler(this.Test2Button_Click);
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(580, 473);
+ this.Controls.Add(this.Test2Button);
+ this.Controls.Add(this.Test1Button);
+ this.Controls.Add(this.panel);
+ this.Name = "MainForm";
+ this.Text = "Cef Usage Tests";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel;
+ private System.Windows.Forms.Button Test1Button;
+ private System.Windows.Forms.Button Test2Button;
+ }
+}
+
View
138 CefUsageTests/MainForm.cs
@@ -1,69 +1,69 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using CefSharp;
-
-namespace CefUsageTests
-{
- public partial class MainForm : Form
- {
- public MainForm()
- {
- InitializeComponent();
- }
-
- private void PrepareTest()
- {
- if (browser != null)
- {
- browser.Dispose();
- browser = null;
- }
- }
-
- private CefFormsWebBrowser browser;
- private void Test1Button_Click(object sender, EventArgs e)
- {
- // This is "default" usage of control.
- // We don't call CEF.Initialization - it's called implicitly by CefWebBrowser constructor.
- // Note, that CEF.Shutdown must called explicitly.
- // Also, CEF.Shutdown now is safe to call, even if CEF.Initialization not called before.
-
- PrepareTest();
- browser = new CefFormsWebBrowser("http://google.com", new BrowserSettings());
- browser.Parent = panel;
- browser.Dock = DockStyle.Fill;
- }
-
- private void Test2Button_Click(object sender, EventArgs e)
- {
- // This is demonstration of async browser construction.
- // .Load method raises exception with message 'CefBrowser is not ready.', cause underlying CefBrowser doesn't created.
-
- // I propose to that .Load method locks internally and wait for CefBrowser (AfterHandleCreated message).
- // But note, that lock also lock main message loop (if called from UI thread), or we can got inifinite lock, if no message arrived - so some timeout required.
- // If we have plans to support singlethreaded cef message loop - we must process cef message loop.
- // We can give name for event AfterHandleCreated as BrowserReady or Ready.
- // Note, that this is event only signals, that browser constructed, - this is NOT DocumentReady or Navigated.
- // Also .BrowserReady event is good, but method to perform sync operation also can be useful.
-
- PrepareTest();
- browser = new CefFormsWebBrowser();
- browser.Parent = panel;
- browser.Dock = DockStyle.Fill;
- try
- {
- browser.Load("http://google.com");
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using CefSharp;
+
+namespace CefUsageTests
+{
+ public partial class MainForm : Form
+ {
+ public MainForm()
+ {
+ InitializeComponent();
+ }
+
+ private void PrepareTest()
+ {
+ if (browser != null)
+ {
+ browser.Dispose();
+ browser = null;
+ }
+ }
+
+ private CefFormsWebBrowser browser;
+ private void Test1Button_Click(object sender, EventArgs e)
+ {
+ // This is "default" usage of control.
+ // We don't call CEF.Initialization - it's called implicitly by CefWebBrowser constructor.
+ // Note, that CEF.Shutdown must called explicitly.
+ // Also, CEF.Shutdown now is safe to call, even if CEF.Initialization not called before.
+
+ PrepareTest();
+ browser = new CefFormsWebBrowser("http://google.com", new BrowserSettings());
+ browser.Parent = panel;
+ browser.Dock = DockStyle.Fill;
+ }
+
+ private void Test2Button_Click(object sender, EventArgs e)
+ {
+ // This is demonstration of async browser construction.
+ // .Load method raises exception with message 'CefBrowser is not ready.', cause underlying CefBrowser doesn't created.
+
+ // I propose to that .Load method locks internally and wait for CefBrowser (AfterHandleCreated message).
+ // But note, that lock also lock main message loop (if called from UI thread), or we can got inifinite lock, if no message arrived - so some timeout required.
+ // If we have plans to support singlethreaded cef message loop - we must process cef message loop.
+ // We can give name for event AfterHandleCreated as BrowserReady or Ready.
+ // Note, that this is event only signals, that browser constructed, - this is NOT DocumentReady or Navigated.
+ // Also .BrowserReady event is good, but method to perform sync operation also can be useful.
+
+ PrepareTest();
+ browser = new CefFormsWebBrowser();
+ browser.Parent = panel;
+ browser.Dock = DockStyle.Fill;
+ try
+ {
+ browser.Load("http://google.com");
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.ToString());
+ }
+ }
+ }
+}
View
42 CefUsageTests/Program.cs
@@ -1,21 +1,21 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Windows.Forms;
-
-namespace CefUsageTests
-{
- static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new MainForm());
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace CefUsageTests
+{
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainForm());
+ }
+ }
+}
View
72 CefUsageTests/Properties/AssemblyInfo.cs
@@ -1,36 +1,36 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 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("CefUsageTests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("CefUsageTests")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
-[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
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("591bc205-9593-4f0f-a56e-503728ee0cc3")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// 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")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 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("CefUsageTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("CefUsageTests")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[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
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("591bc205-9593-4f0f-a56e-503728ee0cc3")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// 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")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
View
126 CefUsageTests/Properties/Resources.Designer.cs
@@ -1,63 +1,63 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.488
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace CefUsageTests.Properties {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [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>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CefUsageTests.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.488
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CefUsageTests.Properties {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [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>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CefUsageTests.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
View
52 CefUsageTests/Properties/Settings.Designer.cs
@@ -1,26 +1,26 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.488
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace CefUsageTests.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
- }
-}
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.488
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CefUsageTests.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.