Skip to content

Commit

Permalink
Update to Cef Version 59.0.0
Browse files Browse the repository at this point in the history
Note that there is one breaking change as offscreen windows are now automatically transparent due to this cef change: https://bitbucket.org/chromiumembedded/cef/commits/3f71138d64586d774f645a6db5283b5205ea9df4

To make a offscreen window non-transparent you need to set the background colour as shown below were it is set to white:

browserSettings.BackgroundColor = 0255255255;
  • Loading branch information
GrabzIt committed Aug 18, 2017
1 parent 2c14ac6 commit 35f9cc3
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\cef.sdk.3.3029.1611\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.3029.1611\build\cef.sdk.props')" />
<Import Project="..\packages\cef.sdk.3.3071.1634\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.3071.1634\build\cef.sdk.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -66,9 +66,7 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros">
<NuGetPackageImportStamp>0c266be5</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<LinkKeyFile>..\CefSharp.snk</LinkKeyFile>
Expand Down Expand Up @@ -221,11 +219,17 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.sdk.3.3071.1634\build\cef.sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.sdk.3.3071.1634\build\cef.sdk.props'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
<None Include="packages.config" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion CefSharp.BrowserSubprocess.Core/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.sdk" version="3.3029.1611" targetFramework="Native" />
<package id="cef.sdk" version="3.3071.1634" targetFramework="native" />
</packages>
13 changes: 9 additions & 4 deletions CefSharp.Core/CefSharp.Core.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\cef.sdk.3.3029.1611\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.3029.1611\build\cef.sdk.props')" />
<Import Project="..\packages\cef.sdk.3.3071.1634\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.3071.1634\build\cef.sdk.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -67,7 +67,6 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.51106.1</_ProjectFileVersion>
<NuGetPackageImportStamp>892d6872</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>bin\$(Platform)\$(Configuration)\</OutDir>
Expand Down Expand Up @@ -329,11 +328,17 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.sdk.3.3071.1634\build\cef.sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.sdk.3.3071.1634\build\cef.sdk.props'))" />
</Target>
</Project>
4 changes: 2 additions & 2 deletions CefSharp.Core/CefSharp.Core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
<None Include="packages.config" />
</ItemGroup>
</Project>
5 changes: 2 additions & 3 deletions CefSharp.Core/ManagedCefBrowserAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ void ManagedCefBrowserAdapter::CreateOffscreenBrowser(IntPtr windowHandle, Brows
auto hwnd = static_cast<HWND>(windowHandle.ToPointer());

CefWindowInfo window;
auto transparent = browserSettings->OffScreenTransparentBackground.GetValueOrDefault(true);
window.SetAsWindowless(hwnd, transparent);
window.SetAsWindowless(hwnd);
CefString addressNative = StringUtils::ToNative(address);

if (!CefBrowserHost::CreateBrowser(window, _clientAdapter.get(), addressNative,
*browserSettings->_browserSettings, requestContext))
*browserSettings->_browserSettings, *requestContext))
{
throw gcnew InvalidOperationException("Failed to create offscreen browser. Call Cef.Initialize() first.");
}
Expand Down
16 changes: 2 additions & 14 deletions CefSharp.Core/WindowInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,6 @@ namespace CefSharp
}
}

virtual property bool TransparentPaintingEnabled
{
bool get()
{
return _windowInfo->transparent_painting_enabled == 1;
}
void set(bool transparentPaintingEnabled)
{
_windowInfo->transparent_painting_enabled = transparentPaintingEnabled;
}
}

virtual property bool WindowlessRenderingEnabled
{
bool get()
Expand Down Expand Up @@ -170,9 +158,9 @@ namespace CefSharp
_windowInfo->SetAsPopup((HWND)parentHandle.ToPointer(), StringUtils::ToNative(windowName));
}

virtual void SetAsWindowless(IntPtr parentHandle, bool transparent)
virtual void SetAsWindowless(IntPtr parentHandle)
{
_windowInfo->SetAsWindowless((HWND)parentHandle.ToPointer(), transparent);
_windowInfo->SetAsWindowless((HWND)parentHandle.ToPointer());
}

CefWindowInfo* GetWindowInfo()
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.sdk" version="3.3029.1611" targetFramework="Native" />
<package id="cef.sdk" version="3.3071.1634" targetFramework="native" />
</packages>
14 changes: 11 additions & 3 deletions CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<NuGetPackageImportStamp>8b6c24fc</NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -95,6 +96,13 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\CefSharp.props" />
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="..\packages\cef.redist.x64.3.3029.1611\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.3029.1611\build\cef.redist.x64.targets')" />
<Import Project="..\packages\cef.redist.x86.3.3029.1611\build\cef.redist.x86.targets" Condition="Exists('..\packages\cef.redist.x86.3.3029.1611\build\cef.redist.x86.targets')" />
<Import Project="..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets'))" />
</Target>
<Import Project="..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets" Condition="Exists('..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets')" />
</Project>
4 changes: 2 additions & 2 deletions CefSharp.OffScreen.Example/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist.x64" version="3.3029.1611" targetFramework="net452" />
<package id="cef.redist.x86" version="3.3029.1611" targetFramework="net452" />
<package id="cef.redist.x64" version="3.3071.1634" targetFramework="net452" />
<package id="cef.redist.x86" version="3.3071.1634" targetFramework="net452" />
</packages>
14 changes: 11 additions & 3 deletions CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>5f632012</NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
Expand Down Expand Up @@ -185,6 +186,13 @@
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="..\packages\cef.redist.x64.3.2272.30\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.2272.30\build\cef.redist.x64.targets')" />
<Import Project="..\packages\cef.redist.x86.3.2272.30\build\cef.redist.x86.targets" Condition="Exists('..\packages\cef.redist.x86.3.2272.30\build\cef.redist.x86.targets')" />
<Import Project="..\packages\cef.redist.x64.3.3029.1611\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.3029.1611\build\cef.redist.x64.targets')" />
<Import Project="..\packages\cef.redist.x86.3.3029.1611\build\cef.redist.x86.targets" Condition="Exists('..\packages\cef.redist.x86.3.3029.1611\build\cef.redist.x86.targets')" />
<Import Project="..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets'))" />
</Target>
<Import Project="..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets" Condition="Exists('..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets')" />
</Project>
4 changes: 2 additions & 2 deletions CefSharp.WinForms.Example/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist.x64" version="3.3029.1611" targetFramework="net452" />
<package id="cef.redist.x86" version="3.3029.1611" targetFramework="net452" />
<package id="cef.redist.x64" version="3.3071.1634" targetFramework="net452" />
<package id="cef.redist.x86" version="3.3071.1634" targetFramework="net452" />
</packages>
14 changes: 11 additions & 3 deletions CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>a03680f0</NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -187,6 +188,13 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\CefSharp.props" />
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="..\packages\cef.redist.x64.3.3029.1611\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.3029.1611\build\cef.redist.x64.targets')" />
<Import Project="..\packages\cef.redist.x86.3.3029.1611\build\cef.redist.x86.targets" Condition="Exists('..\packages\cef.redist.x86.3.3029.1611\build\cef.redist.x86.targets')" />
<Import Project="..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.3.3071.1634\build\cef.redist.x64.targets'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets'))" />
</Target>
<Import Project="..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets" Condition="Exists('..\packages\cef.redist.x86.3.3071.1634\build\cef.redist.x86.targets')" />
</Project>
4 changes: 2 additions & 2 deletions CefSharp.Wpf.Example/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist.x64" version="3.3029.1611" targetFramework="net452" />
<package id="cef.redist.x86" version="3.3029.1611" targetFramework="net452" />
<package id="cef.redist.x64" version="3.3071.1634" targetFramework="net452" />
<package id="cef.redist.x86" version="3.3071.1634" targetFramework="net452" />
<package id="CommonServiceLocator" version="1.3" targetFramework="net45" />
<package id="MvvmLightLibs" version="5.1.1.0" targetFramework="net45" />
</packages>
7 changes: 2 additions & 5 deletions CefSharp/IWindowInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public interface IWindowInfo : IDisposable
uint Style { get; set; }
uint ExStyle { get; set; }
IntPtr ParentWindowHandle { get; set; }
bool TransparentPaintingEnabled { get; set; }
bool WindowlessRenderingEnabled { get; set; }
IntPtr WindowHandle { get; set; }

Expand All @@ -24,13 +23,11 @@ public interface IWindowInfo : IDisposable

/// <summary>
/// Create the browser using windowless (off-screen) rendering.
/// No window will be created for the browser and all rendering will occur via the CefRenderHandler interface.
/// No window will be created for the browser and all rendering will occur via the CefRenderHandler interface. This window will automatically be transparent unless a colored backgrond is set in the browser settings.
/// </summary>
/// <param name="parentHandle">Value will be used to identify monitor info and to act as the parent window for dialogs, context menus, etc.
/// If not provided then the main screen monitor will be used and some functionality that requires a parent window may not function correctly.</param>
/// <param name="transparent">If is true a transparent background color will be used (RGBA=0x00000000).
/// If is false the background will be white and opaque.
/// In order to create windowless browsers the CefSettings.windowless_rendering_enabled value must be set to true.</param>
void SetAsWindowless(IntPtr parentHandle, bool transparent);
void SetAsWindowless(IntPtr parentHandle);
}
}
4 changes: 2 additions & 2 deletions CefSharp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public static class AssemblyInfo
public const bool ComVisible = false;
public const string AssemblyCompany = "The CefSharp Authors";
public const string AssemblyProduct = "CefSharp";
public const string AssemblyVersion = "58.0.0";
public const string AssemblyFileVersion = "58.0.0.0";
public const string AssemblyVersion = "59.0.0";
public const string AssemblyFileVersion = "59.0.0.0";
public const string AssemblyCopyright = "Copyright © 2010-2017 The CefSharp Authors";
public const string CefSharpCoreProject = "CefSharp.Core, PublicKey=" + PublicKey;
public const string CefSharpBrowserSubprocessProject = "CefSharp.BrowserSubprocess, PublicKey=" + PublicKey;
Expand Down

0 comments on commit 35f9cc3

Please sign in to comment.