From 057d7f813d337fd9be290253a8c76df9f69d9ced Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 25 Jun 2014 12:11:08 +1000 Subject: [PATCH 01/38] OnAddressChanged now loads "newValue", allows for more consistent overriding. --- CefSharp.Wpf/ChromiumWebBrowser.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index 48e9815cb..20a556476 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -165,7 +165,7 @@ namespace CefSharp.Wpf Dispatcher ); - managedCefBrowserAdapter.LoadUrl(Address); + managedCefBrowserAdapter.LoadUrl(newValue); } #endregion Address dependency property From 4e2973b2a1e6d00c085a8eb20d2f0fce53802fa3 Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 11 Sep 2014 16:33:51 +1000 Subject: [PATCH 02/38] Extract Loading of Url from OnAddressChanged and put in Load(url) method so can be called directly if required. --- CefSharp.Wpf/ChromiumWebBrowser.cs | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index 20a556476..9963aee10 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -151,21 +151,7 @@ namespace CefSharp.Wpf return; } - if (!Cef.IsInitialized && - !Cef.Initialize()) - { - throw new InvalidOperationException("Cef::Initialize() failed"); - } - - // TODO: Consider making the delay here configurable. - tooltipTimer = new DispatcherTimer( - TimeSpan.FromSeconds(0.5), - DispatcherPriority.Render, - OnTooltipTimerTick, - Dispatcher - ); - - managedCefBrowserAdapter.LoadUrl(newValue); + Load(newValue); } #endregion Address dependency property @@ -926,7 +912,21 @@ namespace CefSharp.Wpf public void Load(string url) { - throw new NotImplementedException(); + if (!Cef.IsInitialized && + !Cef.Initialize()) + { + throw new InvalidOperationException("Cef::Initialize() failed"); + } + + // TODO: Consider making the delay here configurable. + tooltipTimer = new DispatcherTimer( + TimeSpan.FromSeconds(0.5), + DispatcherPriority.Render, + OnTooltipTimerTick, + Dispatcher + ); + + managedCefBrowserAdapter.LoadUrl(url); } public void LoadHtml(string html, string url) From 770ff154861e7566db64d83f921fa24ae98162f9 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Thu, 18 Sep 2014 17:44:03 +0200 Subject: [PATCH 03/38] update cef.sdk/redist to 3.1750.1738-pre0 --- .nuget/packages.config | 2 +- CefSharp.Core/CefSharp.Core.vcxproj | 8 +++++--- CefSharp.Core/packages.config | 2 +- NuGet/CefSharp.Common.nuspec | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.nuget/packages.config b/.nuget/packages.config index 19acf452e..faf951952 100644 --- a/.nuget/packages.config +++ b/.nuget/packages.config @@ -1,4 +1,4 @@  - + diff --git a/CefSharp.Core/CefSharp.Core.vcxproj b/CefSharp.Core/CefSharp.Core.vcxproj index 3dbd3f27b..c977f2e4f 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj +++ b/CefSharp.Core/CefSharp.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -275,7 +275,9 @@ - + + Designer + @@ -283,6 +285,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.Core/packages.config b/CefSharp.Core/packages.config index d52c16f88..f5e65f600 100644 --- a/CefSharp.Core/packages.config +++ b/CefSharp.Core/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/NuGet/CefSharp.Common.nuspec b/NuGet/CefSharp.Common.nuspec index 5556bfbf3..31809cf83 100644 --- a/NuGet/CefSharp.Common.nuspec +++ b/NuGet/CefSharp.Common.nuspec @@ -12,7 +12,7 @@ chrome browser Copyright © 2010-2014 The CefSharp Authors - + From d130ba5c47f6bd987273b3d26dbdfde1430378bc Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Thu, 18 Sep 2014 17:46:12 +0200 Subject: [PATCH 04/38] disable cef sandbox --- CefSharp.Core/Cef.h | 4 ++-- CefSharp.Core/CefAppWrapper.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CefSharp.Core/Cef.h b/CefSharp.Core/Cef.h index 588818351..84de05ff4 100644 --- a/CefSharp.Core/Cef.h +++ b/CefSharp.Core/Cef.h @@ -155,7 +155,7 @@ namespace CefSharp CefMainArgs main_args; CefRefPtr app(new CefSharpApp(cefSettings)); - int exitCode = CefExecuteProcess(main_args, app.get()); + int exitCode = CefExecuteProcess(main_args, app.get(), NULL); if (exitCode >= 0) { @@ -164,7 +164,7 @@ namespace CefSharp return false; } - success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get()); + success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get(), NULL); app->CompleteSchemeRegistrations(); _initialized = success; diff --git a/CefSharp.Core/CefAppWrapper.cpp b/CefSharp.Core/CefAppWrapper.cpp index 90c006ae5..6ac48011c 100644 --- a/CefSharp.Core/CefAppWrapper.cpp +++ b/CefSharp.Core/CefAppWrapper.cpp @@ -26,6 +26,6 @@ namespace CefSharp CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer()); - return CefExecuteProcess(cefMainArgs, (CefApp*)cefApp.get()); + return CefExecuteProcess(cefMainArgs, (CefApp*)cefApp.get(), NULL); } } \ No newline at end of file From 10a7740bb1c43eb715700085ab5068eb63c75086 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Thu, 18 Sep 2014 17:46:27 +0200 Subject: [PATCH 05/38] remove unneeded instantiation --- CefSharp.Core/Internals/ClientAdapter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/CefSharp.Core/Internals/ClientAdapter.cpp b/CefSharp.Core/Internals/ClientAdapter.cpp index 98d0fb2cd..9df2d2f6a 100644 --- a/CefSharp.Core/Internals/ClientAdapter.cpp +++ b/CefSharp.Core/Internals/ClientAdapter.cpp @@ -262,8 +262,6 @@ namespace CefSharp } else if (requestResponse->Action == ResponseAction::Respond) { - CefRefPtr adapter = new StreamAdapter(requestResponse->ResponseStream); - throw gcnew NotImplementedException("Respond is not yet supported."); //resourceStream = CefStreamReader::CreateForHandler(static_cast>(adapter)); From c734580d1ad9f181d466ad7080d2308f5c6e8141 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Thu, 18 Sep 2014 17:46:48 +0200 Subject: [PATCH 06/38] disable these until we can investigate what happened to them --- CefSharp.Core/BrowserSettings.h | 8 ++++---- CefSharp.Core/ManagedCefBrowserAdapter.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CefSharp.Core/BrowserSettings.h b/CefSharp.Core/BrowserSettings.h index 5ddcf4652..dbd1715b7 100644 --- a/CefSharp.Core/BrowserSettings.h +++ b/CefSharp.Core/BrowserSettings.h @@ -250,14 +250,14 @@ namespace CefSharp property String^ UserStyleSheetLocation { - String^ get() { return StringUtils::ToClr(_browserSettings->user_style_sheet_location); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->user_style_sheet_location, value); } + String^ get() { return String::Empty; } + void set(String^ value) { /* todo: fixme */ } } property Nullable^ AuthorAndUserStylesDisabled { - Nullable^ get() { return CefStateToDisabledSetting(_browserSettings->author_and_user_styles); } - void set(Nullable^ value) { _browserSettings->author_and_user_styles = CefStateFromDisabledSetting(value); } + Nullable^ get() { return Nullable(); } + void set(Nullable^ value) { /* todo: fixme */ } } property Nullable^ LocalStorageDisabled diff --git a/CefSharp.Core/ManagedCefBrowserAdapter.h b/CefSharp.Core/ManagedCefBrowserAdapter.h index 257c39650..fc252ee55 100644 --- a/CefSharp.Core/ManagedCefBrowserAdapter.h +++ b/CefSharp.Core/ManagedCefBrowserAdapter.h @@ -46,7 +46,7 @@ namespace CefSharp if (cefHost != nullptr) { - return StringUtils::ToClr(cefHost->GetDevToolsURL(true)); + return String::Empty; } else { From 7cc80137399f843d230ae3e012c0291f3772ae28 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Thu, 18 Sep 2014 19:53:00 +0200 Subject: [PATCH 07/38] according to https://github.com/peters/CefSharp/commit/c734580d1ad9f181d466ad7080d2308f5c6e8141#commitcomment-7839142 these two fellas have been nuked from CEF --- CefSharp.Core/BrowserSettings.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/CefSharp.Core/BrowserSettings.h b/CefSharp.Core/BrowserSettings.h index dbd1715b7..dcd6be4e9 100644 --- a/CefSharp.Core/BrowserSettings.h +++ b/CefSharp.Core/BrowserSettings.h @@ -248,18 +248,6 @@ namespace CefSharp void set(Nullable^ value) { _browserSettings->tab_to_links = CefStateFromDisabledSetting(value); } } - property String^ UserStyleSheetLocation - { - String^ get() { return String::Empty; } - void set(String^ value) { /* todo: fixme */ } - } - - property Nullable^ AuthorAndUserStylesDisabled - { - Nullable^ get() { return Nullable(); } - void set(Nullable^ value) { /* todo: fixme */ } - } - property Nullable^ LocalStorageDisabled { Nullable^ get() { return CefStateToDisabledSetting(_browserSettings->local_storage); } From d5b606e6a5dbe7f159f81354ba4eb4d3e461589d Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Thu, 18 Sep 2014 20:56:37 +0200 Subject: [PATCH 08/38] bump package version --- NuGet/pack.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet/pack.bat b/NuGet/pack.bat index d5f098513..7eacc986f 100644 --- a/NuGet/pack.bat +++ b/NuGet/pack.bat @@ -1,4 +1,4 @@ -set version=31.0.0-pre1 +set version=33.0.0-pre0 NuGet pack CefSharp.Common.nuspec -NoPackageAnalysis -Version %version% NuGet pack CefSharp.Wpf.nuspec -NoPackageAnalysis -Version %version% rem NuGet pack CefSharp.WinForms.nuspec -NoPackageAnalysis -Version %version% From 5c465fe325ef65c6d6d7afb8344085278a642e94 Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 13:10:08 +1000 Subject: [PATCH 09/38] Update to -pre1 --- .nuget/packages.config | 2 +- CefSharp.Core/CefSharp.Core.vcxproj | 4 ++-- CefSharp.Core/packages.config | 2 +- NuGet/CefSharp.Common.nuspec | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.nuget/packages.config b/.nuget/packages.config index faf951952..ce8ce97d5 100644 --- a/.nuget/packages.config +++ b/.nuget/packages.config @@ -1,4 +1,4 @@  - + diff --git a/CefSharp.Core/CefSharp.Core.vcxproj b/CefSharp.Core/CefSharp.Core.vcxproj index c977f2e4f..82b35ff0b 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj +++ b/CefSharp.Core/CefSharp.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -285,6 +285,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.Core/packages.config b/CefSharp.Core/packages.config index f5e65f600..57b1fbdbf 100644 --- a/CefSharp.Core/packages.config +++ b/CefSharp.Core/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/NuGet/CefSharp.Common.nuspec b/NuGet/CefSharp.Common.nuspec index 31809cf83..fceb1d252 100644 --- a/NuGet/CefSharp.Common.nuspec +++ b/NuGet/CefSharp.Common.nuspec @@ -12,7 +12,7 @@ chrome browser Copyright © 2010-2014 The CefSharp Authors - + From 6068136866b9c759a1f7b39bda442435ecc4755e Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 14:05:48 +1000 Subject: [PATCH 10/38] Remove old build target from CefSharp.Wpf.Example.csproj --- CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj | 12 ------------ NuGet.config | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 50c42f29d..2dcc01e60 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -163,18 +163,6 @@ x64 Win32 - - - - - - - - - - - - \ No newline at end of file diff --git a/NuGet.config b/NuGet.config index fdbce8603..40d7b2380 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,7 +2,7 @@ - + From 81c9890363191b7162a2df60bb475a739c4789b4 Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 14:15:47 +1000 Subject: [PATCH 11/38] Remove Native target - will rely on cef.redist package to import it's own target --- CefSharp.Native.props | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/CefSharp.Native.props b/CefSharp.Native.props index 4c70d3d3a..b029883ea 100644 --- a/CefSharp.Native.props +++ b/CefSharp.Native.props @@ -4,19 +4,4 @@ x64 Win32 - - - - - - - - - - - - - - - - + \ No newline at end of file From d79bc6ec0e52fc023c4ae2f813456448c7462001 Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 14:17:48 +1000 Subject: [PATCH 12/38] Import cef.redist into CefSharp.Wpf.Example.csproj --- CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj | 8 ++++++++ CefSharp.Wpf.Example/packages.config | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 CefSharp.Wpf.Example/packages.config diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 2dcc01e60..09652cd57 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -132,6 +132,7 @@ + @@ -165,4 +166,11 @@ + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/packages.config b/CefSharp.Wpf.Example/packages.config new file mode 100644 index 000000000..18d98110c --- /dev/null +++ b/CefSharp.Wpf.Example/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 47c932afadd388d7884bc625e354c20395999b1b Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 14:19:53 +1000 Subject: [PATCH 13/38] Remove CefSharp.Native.props - no longer required with latest nuget --- CefSharp.Native.props | 7 ------- CefSharp.Test/CefSharp.Test.csproj | 8 +++++++- CefSharp.Test/packages.config | 1 + .../CefSharp.WinForms.Example.csproj | 1 - CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj | 5 ----- CefSharp3.sln | 1 - 6 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 CefSharp.Native.props diff --git a/CefSharp.Native.props b/CefSharp.Native.props deleted file mode 100644 index b029883ea..000000000 --- a/CefSharp.Native.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - x64 - Win32 - - \ No newline at end of file diff --git a/CefSharp.Test/CefSharp.Test.csproj b/CefSharp.Test/CefSharp.Test.csproj index d456060a3..e0a7e5cde 100644 --- a/CefSharp.Test/CefSharp.Test.csproj +++ b/CefSharp.Test/CefSharp.Test.csproj @@ -134,5 +134,11 @@ --> - + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/CefSharp.Test/packages.config b/CefSharp.Test/packages.config index ff0fd105c..e1fab74b3 100644 --- a/CefSharp.Test/packages.config +++ b/CefSharp.Test/packages.config @@ -2,6 +2,7 @@ + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index ca16c7673..46364092f 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -127,5 +127,4 @@ - \ No newline at end of file diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 09652cd57..2484daa36 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -160,12 +160,7 @@ - - x64 - Win32 - - diff --git a/CefSharp3.sln b/CefSharp3.sln index 92156222f..f3fade821 100644 --- a/CefSharp3.sln +++ b/CefSharp3.sln @@ -15,7 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Wpf.Example", "Cef EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{47D0DC8C-D707-4D8A-A578-7737AA9CE79B}" ProjectSection(SolutionItems) = preProject - CefSharp.Native.props = CefSharp.Native.props CefSharp.props = CefSharp.props ChangeLog.md = ChangeLog.md LICENSE = LICENSE From 71fa1354dfa027163532d42e8e65fd7ad20bed6e Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 14:30:55 +1000 Subject: [PATCH 14/38] Revert change to NuGet.config - was for local testing only --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 40d7b2380..fdbce8603 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,7 +2,7 @@ - + From e0ca4e638af6d5fab270ac3ff760328a2891b46f Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 14:33:12 +1000 Subject: [PATCH 15/38] Remove DevToolsUrl - no longer valid in 1750 --- CefSharp.Core/ManagedCefBrowserAdapter.h | 17 ----------------- CefSharp.WinForms/ChromiumWebBrowser.cs | 6 ------ CefSharp.Wpf/ChromiumWebBrowser.cs | 6 ------ 3 files changed, 29 deletions(-) diff --git a/CefSharp.Core/ManagedCefBrowserAdapter.h b/CefSharp.Core/ManagedCefBrowserAdapter.h index fc252ee55..aedb608c4 100644 --- a/CefSharp.Core/ManagedCefBrowserAdapter.h +++ b/CefSharp.Core/ManagedCefBrowserAdapter.h @@ -38,23 +38,6 @@ namespace CefSharp }; public: - property String^ DevToolsUrl - { - String^ get() - { - auto cefHost = _renderClientAdapter->TryGetCefHost(); - - if (cefHost != nullptr) - { - return String::Empty; - } - else - { - return nullptr; - } - } - } - ManagedCefBrowserAdapter(IWebBrowserInternal^ webBrowserInternal) { _webBrowserInternal = webBrowserInternal; diff --git a/CefSharp.WinForms/ChromiumWebBrowser.cs b/CefSharp.WinForms/ChromiumWebBrowser.cs index b078a2466..ea7d47c01 100644 --- a/CefSharp.WinForms/ChromiumWebBrowser.cs +++ b/CefSharp.WinForms/ChromiumWebBrowser.cs @@ -242,7 +242,6 @@ namespace CefSharp.WinForms void IWebBrowserInternal.ShowDevTools() { // TODO: Do something about this one. - var devToolsUrl = managedCefBrowserAdapter.DevToolsUrl; throw new NotImplementedException("Implement when Cef upgraded to 1750."); } @@ -251,11 +250,6 @@ namespace CefSharp.WinForms throw new NotImplementedException("Implement when Cef upgraded to 1750."); } - public string DevToolsUrl - { - get { return managedCefBrowserAdapter.DevToolsUrl; } - } - public void Stop() { managedCefBrowserAdapter.Stop(); diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index 79faa469f..8b0232239 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -1055,7 +1055,6 @@ namespace CefSharp.Wpf void IWebBrowserInternal.ShowDevTools() { // TODO: Do something about this one. - var devToolsUrl = managedCefBrowserAdapter.DevToolsUrl; throw new NotImplementedException("Implement when Cef upgraded to 1750."); } @@ -1064,11 +1063,6 @@ namespace CefSharp.Wpf throw new NotImplementedException("Implement when Cef upgraded to 1750."); } - public string DevToolsUrl - { - get { return managedCefBrowserAdapter.DevToolsUrl; } - } - void IWebBrowserInternal.OnFrameLoadStart(string url, bool isMainFrame) { var handler = FrameLoadStart; From 2ebf3bc362938d463e9e1a63fbec3103013d6eda Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 15:41:49 +1000 Subject: [PATCH 16/38] Add cef.redist to WinForms example --- .../CefSharp.WinForms.Example.csproj | 8 ++++++++ CefSharp.WinForms.Example/packages.config | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 CefSharp.WinForms.Example/packages.config diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index 46364092f..99a859447 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -93,6 +93,7 @@ + @@ -127,4 +128,11 @@ + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/packages.config b/CefSharp.WinForms.Example/packages.config new file mode 100644 index 000000000..18d98110c --- /dev/null +++ b/CefSharp.WinForms.Example/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From a80efc0a74d868f0d6e118c36a45e1567ec0f7c2 Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 15:42:12 +1000 Subject: [PATCH 17/38] Update AssemblyInfo version from 31 to 33 --- CefSharp/Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CefSharp/Properties/AssemblyInfo.cs b/CefSharp/Properties/AssemblyInfo.cs index 5eff7a658..6a9cb7ff4 100644 --- a/CefSharp/Properties/AssemblyInfo.cs +++ b/CefSharp/Properties/AssemblyInfo.cs @@ -32,8 +32,8 @@ namespace CefSharp public const bool ComVisible = false; public const string AssemblyCompany = "The CefSharp Authors"; public const string AssemblyProduct = "CefSharp"; - public const string AssemblyVersion = "31.0.0.0"; - public const string AssemblyFileVersion = "31.0.0.0"; + public const string AssemblyVersion = "33.0.0.0"; + public const string AssemblyFileVersion = "33.0.0.0"; public const string AssemblyCopyright = "Copyright © The CefSharp Authors 2010-2014"; public const string CefSharpCoreProject = "CefSharp.Core, PublicKey=" + PublicKey; public const string CefSharpBrowserSubprocessProject = "CefSharp.BrowserSubprocess, PublicKey=" + PublicKey; From cbb5cb59d5f19611a76549472e3975d3ec83bb5f Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 15:51:54 +1000 Subject: [PATCH 18/38] Increase logging to Verbose for examples --- CefSharp.Example/CefExample.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index e4b2e3989..7d2b4cbc8 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -14,6 +14,7 @@ namespace CefSharp.Example { var settings = new CefSettings(); settings.RemoteDebuggingPort = 8088; + settings.LogSeverity = LogSeverity.Verbose; if (debuggingSubProcess) { From 246cdd3bf2fcb9a48aa8fb5fe83303f1818bb32d Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 15:56:33 +1000 Subject: [PATCH 19/38] Re-Add CefSharp.Native.props - needed for browser subprocess --- CefSharp.Native.props | 10 ++++++++++ CefSharp.Test/CefSharp.Test.csproj | 1 + .../CefSharp.WinForms.Example.csproj | 1 + CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj | 1 + CefSharp3.sln | 1 + 5 files changed, 14 insertions(+) create mode 100644 CefSharp.Native.props diff --git a/CefSharp.Native.props b/CefSharp.Native.props new file mode 100644 index 000000000..56b6b68c7 --- /dev/null +++ b/CefSharp.Native.props @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/CefSharp.Test/CefSharp.Test.csproj b/CefSharp.Test/CefSharp.Test.csproj index e0a7e5cde..e7f44f0d2 100644 --- a/CefSharp.Test/CefSharp.Test.csproj +++ b/CefSharp.Test/CefSharp.Test.csproj @@ -134,6 +134,7 @@ --> + diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index 99a859447..8761dc158 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -128,6 +128,7 @@ + diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 2484daa36..0fb577503 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -161,6 +161,7 @@ + diff --git a/CefSharp3.sln b/CefSharp3.sln index f3fade821..92156222f 100644 --- a/CefSharp3.sln +++ b/CefSharp3.sln @@ -15,6 +15,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Wpf.Example", "Cef EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{47D0DC8C-D707-4D8A-A578-7737AA9CE79B}" ProjectSection(SolutionItems) = preProject + CefSharp.Native.props = CefSharp.Native.props CefSharp.props = CefSharp.props ChangeLog.md = ChangeLog.md LICENSE = LICENSE From 2faddc6d9cdf97f4defa6f0b0561c5b8c5a7d984 Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 29 Sep 2014 10:02:05 +1000 Subject: [PATCH 20/38] Fix warning C4800 - Rather than implicit cast to bool, compare to int --- CefSharp.Core/CefSettings.h | 13 ++++--------- CefSharp.Core/Internals/CookieVisitor.cpp | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CefSharp.Core/CefSettings.h b/CefSharp.Core/CefSettings.h index 03ed5986f..8b421a677 100644 --- a/CefSharp.Core/CefSettings.h +++ b/CefSharp.Core/CefSettings.h @@ -61,7 +61,7 @@ namespace CefSharp public: CefSettings() : _cefSettings(new ::CefSettings()) { - MultiThreadedMessageLoop = true; + _cefSettings->multi_threaded_message_loop = true; } !CefSettings() { delete _cefSettings; } @@ -69,12 +69,7 @@ namespace CefSharp virtual property bool MultiThreadedMessageLoop { - bool get() override { return _cefSettings->multi_threaded_message_loop; } - - // CefSharp doesn't support single threaded message loop (and there's little point in supporting it), so we make this - // property read-only externally. - private: - void set(bool value) sealed { _cefSettings->multi_threaded_message_loop = value; } + bool get() override { return _cefSettings->multi_threaded_message_loop == 1; } } virtual property String^ BrowserSubprocessPath @@ -91,7 +86,7 @@ namespace CefSharp virtual property bool IgnoreCertificateErrors { - bool get() { return _cefSettings->ignore_certificate_errors; } + bool get() { return _cefSettings->ignore_certificate_errors == 1; } void set(bool value) { _cefSettings->ignore_certificate_errors = value; } } @@ -121,7 +116,7 @@ namespace CefSharp virtual property bool PackLoadingDisabled { - bool get() override { return _cefSettings->pack_loading_disabled; } + bool get() override { return _cefSettings->pack_loading_disabled == 1; } void set(bool value) override { _cefSettings->pack_loading_disabled = value; } } diff --git a/CefSharp.Core/Internals/CookieVisitor.cpp b/CefSharp.Core/Internals/CookieVisitor.cpp index a38995ace..694258619 100644 --- a/CefSharp.Core/Internals/CookieVisitor.cpp +++ b/CefSharp.Core/Internals/CookieVisitor.cpp @@ -20,8 +20,8 @@ namespace CefSharp cookie->Value = StringUtils::ToClr(cefCookie.value); cookie->Domain = StringUtils::ToClr(cefCookie.domain); cookie->Path = StringUtils::ToClr(cefCookie.path); - cookie->Secure = cefCookie.secure; - cookie->HttpOnly = cefCookie.httponly; + cookie->Secure = cefCookie.secure == 1; + cookie->HttpOnly = cefCookie.httponly == 1; if (cefCookie.has_expires) { From 29649830179b16fbf38d859b94c28a2c0e9c562a Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 29 Sep 2014 10:03:15 +1000 Subject: [PATCH 21/38] Fix Xml comment warning --- CefSharp.Core/Cef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CefSharp.Core/Cef.h b/CefSharp.Core/Cef.h index 84de05ff4..e16fd10a3 100644 --- a/CefSharp.Core/Cef.h +++ b/CefSharp.Core/Cef.h @@ -335,7 +335,7 @@ namespace CefSharp } /// Flush the backing store (if any) to disk and execute the specified |handler| on the IO thread when done. Returns - /// A user-provided Cookie Visitor implementation. + /// A user-provided ICompletionHandler implementation. /// Returns false if cookies cannot be accessed. static bool FlushStore(ICompletionHandler^ handler) { From 2b4884ba2c421cf0d57d4fe0fd1c1391a94979be Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 29 Sep 2014 10:05:12 +1000 Subject: [PATCH 22/38] Fix warning C4800 - compare to int rather than implicit bool conversion --- CefSharp.Core/Internals/ClientAdapter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CefSharp.Core/Internals/ClientAdapter.cpp b/CefSharp.Core/Internals/ClientAdapter.cpp index 9df2d2f6a..c6e752993 100644 --- a/CefSharp.Core/Internals/ClientAdapter.cpp +++ b/CefSharp.Core/Internals/ClientAdapter.cpp @@ -137,7 +137,7 @@ namespace CefSharp // TODO: windows_key_code could possibly be the wrong choice here (the OnKeyEvent signature has changed since CEF1). The // other option would be native_key_code. - return handler->OnKeyEvent(_browserControl, KeyTypeToManaged(event.type), event.windows_key_code, event.modifiers, event.is_system_key); + return handler->OnKeyEvent(_browserControl, KeyTypeToManaged(event.type), event.windows_key_code, event.modifiers, event.is_system_key == 1); } bool ClientAdapter::OnPreKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event, bool* is_keyboard_shortcut) @@ -149,7 +149,7 @@ namespace CefSharp return false; } - return handler->OnPreKeyEvent(_browserControl, (KeyType)event.type, event.windows_key_code, event.native_key_code, event.modifiers, event.is_system_key, *is_keyboard_shortcut); + return handler->OnPreKeyEvent(_browserControl, (KeyType)event.type, event.windows_key_code, event.native_key_code, event.modifiers, event.is_system_key == 1, *is_keyboard_shortcut); } void ClientAdapter::OnLoadStart(CefRefPtr browser, CefRefPtr frame) From e33290a308b842dd666fe432f392d82f9115c576 Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 29 Sep 2014 19:11:09 +1000 Subject: [PATCH 23/38] Upgrade to -pre2 --- .nuget/packages.config | 2 +- CefSharp.Core/CefSharp.Core.vcxproj | 4 ++-- CefSharp.Core/packages.config | 2 +- CefSharp.Test/CefSharp.Test.csproj | 4 ++-- CefSharp.Test/packages.config | 2 +- CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj | 4 ++-- CefSharp.WinForms.Example/packages.config | 2 +- CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj | 4 ++-- CefSharp.Wpf.Example/packages.config | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.nuget/packages.config b/.nuget/packages.config index ce8ce97d5..4e09def7a 100644 --- a/.nuget/packages.config +++ b/.nuget/packages.config @@ -1,4 +1,4 @@  - + diff --git a/CefSharp.Core/CefSharp.Core.vcxproj b/CefSharp.Core/CefSharp.Core.vcxproj index 82b35ff0b..52c2f1f56 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj +++ b/CefSharp.Core/CefSharp.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -285,6 +285,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.Core/packages.config b/CefSharp.Core/packages.config index 57b1fbdbf..693f81f6a 100644 --- a/CefSharp.Core/packages.config +++ b/CefSharp.Core/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/CefSharp.Test/CefSharp.Test.csproj b/CefSharp.Test/CefSharp.Test.csproj index e7f44f0d2..7b46ca042 100644 --- a/CefSharp.Test/CefSharp.Test.csproj +++ b/CefSharp.Test/CefSharp.Test.csproj @@ -135,11 +135,11 @@ --> - + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.Test/packages.config b/CefSharp.Test/packages.config index e1fab74b3..98ecc7bc2 100644 --- a/CefSharp.Test/packages.config +++ b/CefSharp.Test/packages.config @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index 8761dc158..8c0aa86e3 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -129,11 +129,11 @@ - + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/packages.config b/CefSharp.WinForms.Example/packages.config index 18d98110c..611c11e6a 100644 --- a/CefSharp.WinForms.Example/packages.config +++ b/CefSharp.WinForms.Example/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 0fb577503..ce3d6c16c 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -162,11 +162,11 @@ - + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/packages.config b/CefSharp.Wpf.Example/packages.config index 18d98110c..611c11e6a 100644 --- a/CefSharp.Wpf.Example/packages.config +++ b/CefSharp.Wpf.Example/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file From 20ad0f47ed9bc858d10493f169220e5be2f7606e Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 29 Sep 2014 19:48:21 +1000 Subject: [PATCH 24/38] Update to -pre2 version number Add CefSharp.WinForms.nuspec for generation of WinForms package --- NuGet/CefSharp.Common.nuspec | 2 +- NuGet/CefSharp.WinForms.nuspec | 26 ++++++++++++++++++++++++++ NuGet/CefSharp.WinForms.props | 10 ++++++++++ NuGet/pack.bat | 4 ++-- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 NuGet/CefSharp.WinForms.nuspec create mode 100644 NuGet/CefSharp.WinForms.props diff --git a/NuGet/CefSharp.Common.nuspec b/NuGet/CefSharp.Common.nuspec index fceb1d252..be849f4ff 100644 --- a/NuGet/CefSharp.Common.nuspec +++ b/NuGet/CefSharp.Common.nuspec @@ -12,7 +12,7 @@ chrome browser Copyright © 2010-2014 The CefSharp Authors - + diff --git a/NuGet/CefSharp.WinForms.nuspec b/NuGet/CefSharp.WinForms.nuspec new file mode 100644 index 000000000..01c2da4e6 --- /dev/null +++ b/NuGet/CefSharp.WinForms.nuspec @@ -0,0 +1,26 @@ + + + + CefSharp.WinForms + $version$ + The CefSharp Authors + The CefSharp Authors + https://github.com/cefsharp/cefsharp + https://raw.github.com/cefsharp/CefSharp/master/LICENSE + false + The CefSharp Chromium-based browser component (WinForms control). + winforms chrome browser + Copyright © 2010-2014 The CefSharp Authors + + + + + + + + + + + + diff --git a/NuGet/CefSharp.WinForms.props b/NuGet/CefSharp.WinForms.props new file mode 100644 index 000000000..05acaa714 --- /dev/null +++ b/NuGet/CefSharp.WinForms.props @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/NuGet/pack.bat b/NuGet/pack.bat index 7eacc986f..093e6136f 100644 --- a/NuGet/pack.bat +++ b/NuGet/pack.bat @@ -1,4 +1,4 @@ -set version=33.0.0-pre0 +set version=33.0.0-pre2 NuGet pack CefSharp.Common.nuspec -NoPackageAnalysis -Version %version% NuGet pack CefSharp.Wpf.nuspec -NoPackageAnalysis -Version %version% -rem NuGet pack CefSharp.WinForms.nuspec -NoPackageAnalysis -Version %version% +NuGet pack CefSharp.WinForms.nuspec -NoPackageAnalysis -Version %version% From 18153a20173a25b0774a5030e91d4c18c9b1089e Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 29 Sep 2014 20:51:10 +1000 Subject: [PATCH 25/38] Update Home.html to reference Cef 33 (was previously 29) --- CefSharp.Example/Resources/Home.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CefSharp.Example/Resources/Home.html b/CefSharp.Example/Resources/Home.html index e0f345423..b809dee81 100644 --- a/CefSharp.Example/Resources/Home.html +++ b/CefSharp.Example/Resources/Home.html @@ -105,17 +105,17 @@

Perhaps very obvious, but still worth mentioning. Since CefSharp is based on CEF, which is in turn based on - Chromium (version 29 for the time being), CefSharp provides + Chromium (version 33 for the time being), CefSharp provides one of the best HTML5 rendering experiences available - - - 468-470+ points out of 555 + + 470+ points out of 555 on html5test.com. Note: YMMV depending on .DLLs you add and features you enable.

Support for both x86 and x64

- Chromium 29 supports both x86 and x64, and so do we as of CefSharp 3.29.0. For the time being, it does not + Chromium 33 supports both x86 and x64, and so do we as of CefSharp 33.0.0 For the time being, it does not "auto-detect" the platform being used (since this is quite complex), so you have to choose either one for your project. This practically means that you will have to compile & package separate binaries/installers of your app for x86 and x64 respectively if you want/need to support both of them. From 32393d93a5384fdecabab1276d3496dbffa3f468 Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 29 Sep 2014 20:51:42 +1000 Subject: [PATCH 26/38] Update AssemblyInfo.cs in both examples to include correct version and consistent attributes --- .../Properties/AssemblyInfo.cs | 5 ----- CefSharp.Wpf.Example/Properties/AssemblyInfo.cs | 17 ++++++++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/CefSharp.WinForms.Example/Properties/AssemblyInfo.cs b/CefSharp.WinForms.Example/Properties/AssemblyInfo.cs index 18adc9f5a..0f58787eb 100644 --- a/CefSharp.WinForms.Example/Properties/AssemblyInfo.cs +++ b/CefSharp.WinForms.Example/Properties/AssemblyInfo.cs @@ -4,11 +4,6 @@ using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("CefSharp.WinForms.Example")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - [assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)] [assembly: AssemblyProduct(AssemblyInfo.AssemblyProduct)] [assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)] diff --git a/CefSharp.Wpf.Example/Properties/AssemblyInfo.cs b/CefSharp.Wpf.Example/Properties/AssemblyInfo.cs index d4e530020..c747afb17 100644 --- a/CefSharp.Wpf.Example/Properties/AssemblyInfo.cs +++ b/CefSharp.Wpf.Example/Properties/AssemblyInfo.cs @@ -1,10 +1,13 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.InteropServices; +using CefSharp; [assembly: AssemblyTitle("CefSharp.Wpf.Example")] -[assembly: AssemblyCompany("The CefSharp Authors")] -[assembly: AssemblyProduct("CefSharp")] -[assembly: AssemblyCopyright("Copyright © The CefSharp Authors 2010-2014")] - -[assembly: AssemblyVersion("3.29.0.0")] -[assembly: ComVisible(false)] +[assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)] +[assembly: AssemblyProduct(AssemblyInfo.AssemblyProduct)] +[assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)] +[assembly: ComVisible(AssemblyInfo.ComVisible)] +[assembly: AssemblyVersion(AssemblyInfo.AssemblyVersion)] +[assembly: AssemblyFileVersion(AssemblyInfo.AssemblyFileVersion)] +[assembly: CLSCompliant(AssemblyInfo.ClsCompliant)] From c5428255b718df55747d14ece93e3fa33ddcad8e Mon Sep 17 00:00:00 2001 From: jornh Date: Tue, 30 Sep 2014 05:14:27 +0200 Subject: [PATCH 27/38] Re-add upper bound on `cef.redist` versions --- NuGet/CefSharp.Common.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet/CefSharp.Common.nuspec b/NuGet/CefSharp.Common.nuspec index be849f4ff..a5438f3ac 100644 --- a/NuGet/CefSharp.Common.nuspec +++ b/NuGet/CefSharp.Common.nuspec @@ -12,7 +12,7 @@ chrome browser Copyright © 2010-2014 The CefSharp Authors - + From 88072a477d7f1c5b27f33762c7fd60d522236dad Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 30 Sep 2014 15:43:55 +1000 Subject: [PATCH 28/38] Remove Address getter from IWebBrowser Make Address private on ChromiumWebBrowser Still allows for full data binding under MVVM as users will directly access the control in xaml, from a view model they're likely to bind through a Property that is data bound to address and everywhere there's a reference to IWebBrowser then Load(string url) can be called in code --- CefSharp.WinForms/ChromiumWebBrowser.cs | 2 +- CefSharp/IWebBrowser.cs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CefSharp.WinForms/ChromiumWebBrowser.cs b/CefSharp.WinForms/ChromiumWebBrowser.cs index 94cfeaa10..ad49b2ff6 100644 --- a/CefSharp.WinForms/ChromiumWebBrowser.cs +++ b/CefSharp.WinForms/ChromiumWebBrowser.cs @@ -19,7 +19,7 @@ namespace CefSharp.WinForms public string Title { get; set; } public bool IsLoading { get; private set; } public string TooltipText { get; private set; } - public string Address { get; set; } + public string Address { get; private set; } public IDialogHandler DialogHandler { get; set; } public IJsDialogHandler JsDialogHandler { get; set; } diff --git a/CefSharp/IWebBrowser.cs b/CefSharp/IWebBrowser.cs index fb642f8c5..bbed380b8 100644 --- a/CefSharp/IWebBrowser.cs +++ b/CefSharp/IWebBrowser.cs @@ -139,13 +139,12 @@ namespace CefSharp bool CanReload { get; } ///

- /// The address (URL) which the browser control is currently displaying. Can be set to a simplified URL - /// (e.g. www.google.com) or a full URL (e.g. http://www.google.com). Will automatically be updated as the user - /// navigates to another page (e.g. by clicking on a link). + /// The address (URL) which the browser control is currently displaying. + /// Will automatically be updated as the user navigates to another page (e.g. by clicking on a link). /// /// In the WPF control, this property is implemented as a Dependency Property and fully supports data /// binding. - string Address { get; set; } + string Address { get; } /// /// The title of the web page being currently displayed. From 935b24eaea0eb469747fdcc1aadc8c06c30904d2 Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 29 Sep 2014 22:06:06 +1000 Subject: [PATCH 29/38] Remove old class - presumably leftover from CefSharp1 --- CefSharp.Core/BrowserCore.h | 161 ------------------------------------ 1 file changed, 161 deletions(-) delete mode 100644 CefSharp.Core/BrowserCore.h diff --git a/CefSharp.Core/BrowserCore.h b/CefSharp.Core/BrowserCore.h deleted file mode 100644 index d21093beb..000000000 --- a/CefSharp.Core/BrowserCore.h +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright © 2010-2013 The CefSharp Project. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -#pragma once - -#include "Stdafx.h" -#include "RtzCountdownEvent.h" - -using namespace System::ComponentModel; -using namespace System::Collections::Generic; - -namespace CefSharp -{ - interface class ILifeSpanHandler; - interface class IRequestHandler; - interface class IKeyboardHandler; - interface class IJsDialogHandler; - - public ref class BrowserCore : INotifyPropertyChanged - { - private: - RtzCountdownEvent^ _loadCompleted; - - bool _isBrowserInitialized; - bool _canGoBack; - bool _canGoForward; - bool _canReload; - - int _contentsWidth; - int _contentsHeight; - - String^ _tooltip; - String^ _address; - String^ _title; - - ILifeSpanHandler^ _lifeSpanHandler; - IRequestHandler^ _requestHandler; - IKeyboardHandler^ _keyboardHandler; - IJsDialogHandler^ _jsDialogHandler; - - IDictionary^ _boundObjects; - - public: - virtual event PropertyChangedEventHandler^ PropertyChanged; - - BrowserCore(String^ address) - { - _loadCompleted = gcnew RtzCountdownEvent(); - _address = address; - _boundObjects = gcnew Dictionary(); - } - - property bool IsBrowserInitialized - { - bool get() { return _isBrowserInitialized; } - } - - property bool CanGoBack - { - bool get() { return _canGoBack; } - } - - property bool CanGoForward - { - bool get() { return _canGoForward; } - } - - property bool CanReload - { - bool get() { return _canReload; } - } - - property String^ Address - { - String^ get() { return _address; } - - void set(String^ address) - { - if (_address != nullptr && - _address->Equals(address)) - { - // The URI:s are identical, so nothing needs to be done. - return; - } - - _address = address; - PropertyChanged(this, gcnew PropertyChangedEventArgs(L"Address")); - } - } - - property String^ Title - { - String^ get() { return _title; } - - void set(String^ title) - { - if (_title != title) - { - _title = title; - PropertyChanged(this, gcnew PropertyChangedEventArgs(L"Title")); - } - } - } - - virtual property ILifeSpanHandler^ LifeSpanHandler - { - ILifeSpanHandler^ get() { return _lifeSpanHandler; } - void set(ILifeSpanHandler^ handler) { _lifeSpanHandler = handler; } - } - - virtual property IRequestHandler^ RequestHandler - { - IRequestHandler^ get() { return _requestHandler; } - void set(IRequestHandler^ handler) { _requestHandler = handler; } - } - - virtual property IKeyboardHandler^ KeyboardHandler - { - IKeyboardHandler^ get() { return _keyboardHandler; } - void set(IKeyboardHandler^ handler) { _keyboardHandler = handler; } - } - - virtual property IJsDialogHandler^ JsDialogHandler - { - IJsDialogHandler^ get() { return _jsDialogHandler; } - void set(IJsDialogHandler^ handler) { _jsDialogHandler = handler; } - } - - void CheckBrowserInitialization(); - - void RegisterJsObject(String^ name, Object^ objectToBind); - IDictionary^ GetBoundObjects(); - - void SetNavState(bool canGoBack, bool canGoForward, bool canReload) - { - if (canGoBack != _canGoBack) - { - _canGoBack = canGoBack; - PropertyChanged(this, gcnew PropertyChangedEventArgs(L"CanGoBack")); - } - - if (canGoForward != _canGoForward) - { - _canGoForward = canGoForward; - PropertyChanged(this, gcnew PropertyChangedEventArgs(L"CanGoForward")); - } - - if (canReload != _canReload) - { - _canReload = canReload; - PropertyChanged(this, gcnew PropertyChangedEventArgs(L"CanReload")); - } - } - - void OnInitialized(); - void OnLoad(); - void OnFrameLoadStart(); - void OnFrameLoadEnd(); - }; -} From 625b77fb058c21b8ab36087894193b825876c802 Mon Sep 17 00:00:00 2001 From: amaitland Date: Tue, 30 Sep 2014 23:59:09 +1000 Subject: [PATCH 30/38] Fix incorrect IMPLEMENT_REFCOUNTING --- CefSharp.Core/Internals/RenderClientAdapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CefSharp.Core/Internals/RenderClientAdapter.h b/CefSharp.Core/Internals/RenderClientAdapter.h index 18a6dd945..b7d5cdbbe 100644 --- a/CefSharp.Core/Internals/RenderClientAdapter.h +++ b/CefSharp.Core/Internals/RenderClientAdapter.h @@ -198,7 +198,7 @@ namespace CefSharp CopyMemory(*backBufferHandle, (void*)buffer, numberOfBytes); }; - IMPLEMENT_REFCOUNTING(RenderClientAdapterInternal) + IMPLEMENT_REFCOUNTING(RenderClientAdapter) }; } } From 70e776e94dacb87ed93db49d4e4b31b3f6618fb5 Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 1 Oct 2014 22:44:45 +1000 Subject: [PATCH 31/38] Split BeginEvaluateScriptAsync call into two lines, makes more readable and also meets Max columns of 132 style --- CefSharp/Internals/BrowserProcessServiceHost.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CefSharp/Internals/BrowserProcessServiceHost.cs b/CefSharp/Internals/BrowserProcessServiceHost.cs index 930c63715..ed851dd06 100644 --- a/CefSharp/Internals/BrowserProcessServiceHost.cs +++ b/CefSharp/Internals/BrowserProcessServiceHost.cs @@ -55,7 +55,8 @@ namespace CefSharp.Internals { var context = t.Result; var renderProcess = context.GetCallbackChannel(); - return Task.Factory.FromAsync(renderProcess.BeginEvaluateScriptAsync(browserId, frameId, script, timeout, null, null), renderProcess.EndEvaluateScriptAsync); + var asyncResult = renderProcess.BeginEvaluateScriptAsync(browserId, frameId, script, timeout, null, null); + return Task.Factory.FromAsync(asyncResult, renderProcess.EndEvaluateScriptAsync); }).Unwrap(); } From af8a9f7b3aef8eb83f634b66d9f2256e14a420f7 Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 2 Oct 2014 19:46:08 +1000 Subject: [PATCH 32/38] Update to non -pre packages --- .nuget/packages.config | 2 +- CefSharp.Core/CefSharp.Core.vcxproj | 8 +++----- CefSharp.Core/packages.config | 2 +- CefSharp.Test/CefSharp.Test.csproj | 4 ++-- CefSharp.Test/packages.config | 2 +- .../CefSharp.WinForms.Example.csproj | 4 ++-- CefSharp.WinForms.Example/packages.config | 2 +- CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj | 4 ++-- CefSharp.Wpf.Example/packages.config | 2 +- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.nuget/packages.config b/.nuget/packages.config index 4e09def7a..a05271e70 100644 --- a/.nuget/packages.config +++ b/.nuget/packages.config @@ -1,4 +1,4 @@  - + diff --git a/CefSharp.Core/CefSharp.Core.vcxproj b/CefSharp.Core/CefSharp.Core.vcxproj index 52c2f1f56..7a327f27a 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj +++ b/CefSharp.Core/CefSharp.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -275,9 +275,7 @@ - - Designer - + @@ -285,6 +283,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.Core/packages.config b/CefSharp.Core/packages.config index 693f81f6a..bbef23d17 100644 --- a/CefSharp.Core/packages.config +++ b/CefSharp.Core/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/CefSharp.Test/CefSharp.Test.csproj b/CefSharp.Test/CefSharp.Test.csproj index 7b46ca042..0aa234944 100644 --- a/CefSharp.Test/CefSharp.Test.csproj +++ b/CefSharp.Test/CefSharp.Test.csproj @@ -135,11 +135,11 @@ --> - + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.Test/packages.config b/CefSharp.Test/packages.config index 98ecc7bc2..742fc0821 100644 --- a/CefSharp.Test/packages.config +++ b/CefSharp.Test/packages.config @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index 8c0aa86e3..b95e4cbd1 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -129,11 +129,11 @@ - + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/packages.config b/CefSharp.WinForms.Example/packages.config index 611c11e6a..b519c7ce7 100644 --- a/CefSharp.WinForms.Example/packages.config +++ b/CefSharp.WinForms.Example/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index ce3d6c16c..0b0e6b6b4 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -162,11 +162,11 @@ - + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/packages.config b/CefSharp.Wpf.Example/packages.config index 611c11e6a..b519c7ce7 100644 --- a/CefSharp.Wpf.Example/packages.config +++ b/CefSharp.Wpf.Example/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file From 9c5b85179bdf0489cfd012f0744816929783c513 Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 2 Oct 2014 20:17:24 +1000 Subject: [PATCH 33/38] Import cef-binary build.ps1 and modify to produce nuget packages (currently only has vs2013 target enabled) --- build.ps1 | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 build.ps1 diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 000000000..8488d08b8 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,231 @@ +param( + [ValidateSet("vs2013", "vs2012", "nupkg", "nupkg-only")] + [Parameter(Position = 0)] + [string] $Target = "nupkg", + [Parameter(Position = 1)] + [string] $Version = "33.0.0-pre2" +) + +$WorkingDir = split-path -parent $MyInvocation.MyCommand.Definition + +$CefSln = Join-Path $WorkingDir 'CefSharp3.sln' + +# https://github.com/jbake/Powershell_scripts/blob/master/Invoke-BatchFile.ps1 +function Invoke-BatchFile +{ + param( + [Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)] + [string]$Path, + [Parameter(Position = 1, Mandatory = $true, ValueFromPipeline = $true)] + [string]$Parameters + ) + + $tempFile = [IO.Path]::GetTempFileName() + + cmd.exe /c " `"$Path`" $Parameters && set > `"$tempFile`" " + + Get-Content $tempFile | Foreach-Object { + if ($_ -match "^(.*?)=(.*)$") + { + Set-Content "env:\$($matches[1])" $matches[2] + } + } + + Remove-Item $tempFile +} + +function Write-Diagnostic +{ + param( + [Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)] + [string] $Message + ) + + Write-Host + Write-Host $Message -ForegroundColor Green + Write-Host +} + +function Die +{ + param( + [Parameter(Position = 0, ValueFromPipeline = $true)] + [string] $Message + ) + + Write-Host + Write-Error $Message + exit 1 +} + +function Warn +{ + param( + [Parameter(Position = 0, ValueFromPipeline = $true)] + [string] $Message + ) + + Write-Host + Write-Host $Message -ForegroundColor Yellow + Write-Host +} + +function TernaryReturn +{ + param( + [Parameter(Position = 0, ValueFromPipeline = $true)] + [bool] $Yes, + [Parameter(Position = 1, ValueFromPipeline = $true)] + $Value, + [Parameter(Position = 2, ValueFromPipeline = $true)] + $Value2 + ) + + if($Yes) { + return $Value + } + + $Value2 +} + +function Msvs +{ + param( + [ValidateSet('v110', 'v120')] + [Parameter(Position = 0, ValueFromPipeline = $true)] + [string] $Toolchain, + + [Parameter(Position = 1, ValueFromPipeline = $true)] + [ValidateSet('Debug', 'Release')] + [string] $Configuration, + + [Parameter(Position = 2, ValueFromPipeline = $true)] + [ValidateSet('x86', 'x64')] + [string] $Platform + ) + + Write-Diagnostic "Targeting $Toolchain using configuration $Configuration on platform $Platform" + + $VisualStudioVersion = $null + $VXXCommonTools = $null + + switch -Exact ($Toolchain) { + 'v110' { + $VisualStudioVersion = '11.0' + $VXXCommonTools = Join-Path $env:VS110COMNTOOLS '..\..\vc' + } + 'v120' { + $VisualStudioVersion = '12.0' + $VXXCommonTools = Join-Path $env:VS120COMNTOOLS '..\..\vc' + } + } + + if ($VXXCommonTools -eq $null -or (-not (Test-Path($VXXCommonTools)))) { + Die 'Error unable to find any visual studio environment' + } + + $VCVarsAll = Join-Path $VXXCommonTools vcvarsall.bat + if (-not (Test-Path $VCVarsAll)) { + Die "Unable to find $VCVarsAll" + } + + # Only configure build environment once + if($env:CEFSHARP_BUILD_IS_BOOTSTRAPPED -eq $null) { + Invoke-BatchFile $VCVarsAll $Platform + $env:CEFSHARP_BUILD_IS_BOOTSTRAPPED = $true + } + + $Arch = TernaryReturn ($Platform -eq 'x64') 'x64' 'win32' + + $Arguments = @( + "$CefSln", + "/t:rebuild", + "/p:VisualStudioVersion=$VisualStudioVersion", + "/p:Configuration=$Configuration", + "/p:Platform=$Arch" + ) + + $StartInfo = New-Object System.Diagnostics.ProcessStartInfo + $StartInfo.FileName = "msbuild.exe" + $StartInfo.Arguments = $Arguments + + $StartInfo.EnvironmentVariables.Clear() + + Get-ChildItem -Path env:* | ForEach-Object { + $StartInfo.EnvironmentVariables.Add($_.Name, $_.Value) + } + + $StartInfo.UseShellExecute = $false + $StartInfo.CreateNoWindow = $false + + $Process = New-Object System.Diagnostics.Process + $Process.StartInfo = $startInfo + $Process.Start() + $Process.WaitForExit() + + if($Process.ExitCode -ne 0) { + Die "Build failed" + } +} + +function VSX +{ + param( + [ValidateSet('v110', 'v120')] + [Parameter(Position = 0, ValueFromPipeline = $true)] + [string] $Toolchain + ) + + if($Toolchain -eq 'v120' -and $env:VS120COMNTOOLS -eq $null) { + Warn "Toolchain $Toolchain is not installed on your development machine, skipping build." + Return + } + + if($Toolchain -eq 'v110' -and $env:VS110COMNTOOLS -eq $null) { + Warn "Toolchain $Toolchain is not installed on your development machine, skipping build." + Return + } + + Write-Diagnostic "Starting to build targeting toolchain $Toolchain" + + Msvs "$Toolchain" 'Release' 'x86' + Msvs "$Toolchain" 'Release' 'x64' + + Write-Diagnostic "Finished build targeting toolchain $Toolchain" +} + +function Nupkg +{ + $nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe + if(-not (Test-Path $nuget)) { + Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget" + } + + Write-Diagnostic "Building nuget package" + + # Build packages + . $nuget pack nuget\CefSharp.Common.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget + . $nuget pack nuget\CefSharp.Wpf.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget + . $nuget pack nuget\CefSharp.WinForms.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget +} + +switch -Exact ($Target) { + "nupkg" + { + VSX v120 + #VSX v110 + Nupkg + } + "nupkg-only" + { + Nupkg + } + "vs2013" + { + VSX v120 + } + "vs2012" + { + VSX v110 + } +} \ No newline at end of file From 585c884489832fb79351fb9849a67bf453d2e6c3 Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 2 Oct 2014 20:24:49 +1000 Subject: [PATCH 34/38] Add NugetPackageRestore method to restore packages if they don't exist (no need to open VS to build cefsharp3 now) --- build.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.ps1 b/build.ps1 index 8488d08b8..4db47b3ac 100644 --- a/build.ps1 +++ b/build.ps1 @@ -194,6 +194,19 @@ function VSX Write-Diagnostic "Finished build targeting toolchain $Toolchain" } +function NugetPackageRestore +{ + $nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe + if(-not (Test-Path $nuget)) { + Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget" + } + + Write-Diagnostic "Restore Nuget Packages" + + # Restore packages + . $nuget restore $CefSln +} + function Nupkg { $nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe @@ -209,6 +222,8 @@ function Nupkg . $nuget pack nuget\CefSharp.WinForms.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget } +NugetPackageRestore + switch -Exact ($Target) { "nupkg" { From 7dac850c5941d3f9799690b4faca04a4e633d510 Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 2 Oct 2014 20:26:27 +1000 Subject: [PATCH 35/38] Spaces not tabs --- build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 4db47b3ac..5413daef8 100644 --- a/build.ps1 +++ b/build.ps1 @@ -204,7 +204,7 @@ function NugetPackageRestore Write-Diagnostic "Restore Nuget Packages" # Restore packages - . $nuget restore $CefSln + . $nuget restore $CefSln } function Nupkg From a58b6086c7af54057945ce104bf6b57ccac7589f Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 26 Sep 2014 16:53:50 +1000 Subject: [PATCH 36/38] First 1750 feature - ShowDevTools/CloseDevTools --- CefSharp.Core/Internals/RenderClientAdapter.h | 25 +++++++++++++++++++ CefSharp.Core/ManagedCefBrowserAdapter.h | 10 ++++++++ .../BrowserForm.Designer.cs | 4 +-- CefSharp.WinForms.Example/BrowserForm.cs | 10 ++++++++ CefSharp.WinForms/ChromiumWebBrowser.cs | 9 +++---- CefSharp.Wpf/ChromiumWebBrowser.cs | 9 +++---- CefSharp/IWebBrowser.cs | 10 ++++++++ CefSharp/Internals/IWebBrowserInternal.cs | 2 -- 8 files changed, 65 insertions(+), 14 deletions(-) diff --git a/CefSharp.Core/Internals/RenderClientAdapter.h b/CefSharp.Core/Internals/RenderClientAdapter.h index b7d5cdbbe..74b6743a0 100644 --- a/CefSharp.Core/Internals/RenderClientAdapter.h +++ b/CefSharp.Core/Internals/RenderClientAdapter.h @@ -128,6 +128,31 @@ namespace CefSharp return cefBrowser->GetMainFrame(); }; + void ShowDevTools() + { + auto cefHost = TryGetCefHost(); + + if (cefHost != nullptr) + { + CefWindowInfo windowInfo; + CefBrowserSettings settings; + + windowInfo.SetAsPopup(cefHost->GetWindowHandle(), "DevTools"); + + cefHost->ShowDevTools(windowInfo, this, settings); + } + } + + void CloseDevTools() + { + auto cefHost = TryGetCefHost(); + + if (cefHost != nullptr) + { + cefHost->CloseDevTools(); + } + } + private: void SetBuffer(BitmapInfo^ bitmapInfo, int newWidth, int newHeight, const void* buffer) diff --git a/CefSharp.Core/ManagedCefBrowserAdapter.h b/CefSharp.Core/ManagedCefBrowserAdapter.h index aedb608c4..0b8860efe 100644 --- a/CefSharp.Core/ManagedCefBrowserAdapter.h +++ b/CefSharp.Core/ManagedCefBrowserAdapter.h @@ -441,6 +441,16 @@ namespace CefSharp } } + void ShowDevTools() + { + _renderClientAdapter->ShowDevTools(); + } + + void CloseDevTools() + { + _renderClientAdapter->CloseDevTools(); + } + virtual void Error(Exception^ ex) { diff --git a/CefSharp.WinForms.Example/BrowserForm.Designer.cs b/CefSharp.WinForms.Example/BrowserForm.Designer.cs index 35699b84f..56e15ba65 100644 --- a/CefSharp.WinForms.Example/BrowserForm.Designer.cs +++ b/CefSharp.WinForms.Example/BrowserForm.Designer.cs @@ -249,17 +249,17 @@ // // showDevToolsMenuItem // - this.showDevToolsMenuItem.Enabled = false; this.showDevToolsMenuItem.Name = "showDevToolsMenuItem"; this.showDevToolsMenuItem.Size = new System.Drawing.Size(158, 22); this.showDevToolsMenuItem.Text = "Show Dev Tools"; + this.showDevToolsMenuItem.Click += new System.EventHandler(this.ShowDevToolsMenuItemClick); // // closeDevToolsMenuItem // - this.closeDevToolsMenuItem.Enabled = false; this.closeDevToolsMenuItem.Name = "closeDevToolsMenuItem"; this.closeDevToolsMenuItem.Size = new System.Drawing.Size(158, 22); this.closeDevToolsMenuItem.Text = "Close Dev Tools"; + this.closeDevToolsMenuItem.Click += new System.EventHandler(this.CloseDevToolsMenuItemClick); // // toolStripMenuItem3 // diff --git a/CefSharp.WinForms.Example/BrowserForm.cs b/CefSharp.WinForms.Example/BrowserForm.cs index 445326088..e4545a20b 100644 --- a/CefSharp.WinForms.Example/BrowserForm.cs +++ b/CefSharp.WinForms.Example/BrowserForm.cs @@ -240,5 +240,15 @@ namespace CefSharp.WinForms.Example }, TaskScheduler.FromCurrentSynchronizationContext()); } + + private void ShowDevToolsMenuItemClick(object sender, EventArgs e) + { + browser.ShowDevTools(); + } + + private void CloseDevToolsMenuItemClick(object sender, EventArgs e) + { + browser.CloseDevTools(); + } } } diff --git a/CefSharp.WinForms/ChromiumWebBrowser.cs b/CefSharp.WinForms/ChromiumWebBrowser.cs index a95d1d46c..620ea69fb 100644 --- a/CefSharp.WinForms/ChromiumWebBrowser.cs +++ b/CefSharp.WinForms/ChromiumWebBrowser.cs @@ -255,15 +255,14 @@ namespace CefSharp.WinForms managedCefBrowserAdapter.StopFinding(clearSelection); } - void IWebBrowserInternal.ShowDevTools() + public void ShowDevTools() { - // TODO: Do something about this one. - throw new NotImplementedException("Implement when Cef upgraded to 1750."); + managedCefBrowserAdapter.ShowDevTools(); } - void IWebBrowserInternal.CloseDevTools() + public void CloseDevTools() { - throw new NotImplementedException("Implement when Cef upgraded to 1750."); + managedCefBrowserAdapter.CloseDevTools(); } public void Stop() diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index e5b83ed24..4e07c0483 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -1051,15 +1051,14 @@ namespace CefSharp.Wpf }); } - void IWebBrowserInternal.ShowDevTools() + public void ShowDevTools() { - // TODO: Do something about this one. - throw new NotImplementedException("Implement when Cef upgraded to 1750."); + managedCefBrowserAdapter.ShowDevTools(); } - void IWebBrowserInternal.CloseDevTools() + public void CloseDevTools() { - throw new NotImplementedException("Implement when Cef upgraded to 1750."); + managedCefBrowserAdapter.CloseDevTools(); } void IWebBrowserInternal.OnFrameLoadStart(string url, bool isMainFrame) diff --git a/CefSharp/IWebBrowser.cs b/CefSharp/IWebBrowser.cs index bbed380b8..9734a0df8 100644 --- a/CefSharp/IWebBrowser.cs +++ b/CefSharp/IWebBrowser.cs @@ -240,5 +240,15 @@ namespace CefSharp /// Opens a Print Dialog which if used (can be user cancelled) will print the browser contents. /// void Print(); + + /// + /// Open developer tools in its own window. + /// + void ShowDevTools(); + + /// + /// Explicitly close the developer tools window if one exists for this browser instance. + /// + void CloseDevTools(); } } diff --git a/CefSharp/Internals/IWebBrowserInternal.cs b/CefSharp/Internals/IWebBrowserInternal.cs index 605468b8f..ec61b3659 100644 --- a/CefSharp/Internals/IWebBrowserInternal.cs +++ b/CefSharp/Internals/IWebBrowserInternal.cs @@ -17,8 +17,6 @@ namespace CefSharp.Internals void SetNavState(bool canGoBack, bool canGoForward, bool canReload); void SetTitle(string title); void SetTooltipText(string tooltipText); - void ShowDevTools(); - void CloseDevTools(); void OnFrameLoadStart(string url, bool isMainFrame); void OnFrameLoadEnd(string url, bool isMainFrame, int httpStatusCode); From 79ed1f9dfb9f59783115d5769d8b059aec1d8482 Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 3 Oct 2014 18:24:13 +1000 Subject: [PATCH 37/38] Remove DevToolsUrl property (no longer used in 1750) --- CefSharp/IWebBrowser.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CefSharp/IWebBrowser.cs b/CefSharp/IWebBrowser.cs index 293a63241..de4035161 100644 --- a/CefSharp/IWebBrowser.cs +++ b/CefSharp/IWebBrowser.cs @@ -168,11 +168,6 @@ namespace CefSharp /// binding. double ZoomLevel { get; set; } - /// - /// Url which can be loaded in a browser control to view the dev tools - /// - string DevToolsUrl { get; } - /// /// Search for text within the current page. /// From 2fdaa35f44b76bd382b1fd25b0eb9045b58e5b57 Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 3 Oct 2014 18:26:04 +1000 Subject: [PATCH 38/38] Upgrade to Cef 1750 --- CefSharp.BrowserSubprocess.Core/CefAppWrapper.cpp | 2 +- .../CefSharp.BrowserSubprocess.Core.vcxproj | 8 +++++--- CefSharp.BrowserSubprocess.Core/packages.config | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CefSharp.BrowserSubprocess.Core/CefAppWrapper.cpp b/CefSharp.BrowserSubprocess.Core/CefAppWrapper.cpp index 755c83735..a3a2e3fa2 100644 --- a/CefSharp.BrowserSubprocess.Core/CefAppWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/CefAppWrapper.cpp @@ -36,7 +36,7 @@ namespace CefSharp CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer()); - return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get()); + return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get(), NULL); } void CefAppWrapper::Bind(JavascriptRootObject^ rootObject, Func^ createBrowserProxyDelegate) diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj index b10e6d376..5645165db 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -65,7 +65,9 @@ - + + 47d3feda + true ..\CefSharp.snk @@ -196,6 +198,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - +
\ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/packages.config b/CefSharp.BrowserSubprocess.Core/packages.config index bd682d15e..bbef23d17 100644 --- a/CefSharp.BrowserSubprocess.Core/packages.config +++ b/CefSharp.BrowserSubprocess.Core/packages.config @@ -1,4 +1,4 @@ - + - - + + \ No newline at end of file