Skip to content

Commit 24888a2

Browse files
authored
Merge 2c5626a into d0486b3
2 parents d0486b3 + 2c5626a commit 24888a2

24 files changed

+96
-17
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "CefSharp.Wpf.HwndHost"]
2+
path = CefSharp.Wpf.HwndHost
3+
url = https://github.com/cefsharp/CefSharp.Wpf.HwndHost.git

CefSharp.Wpf.Example/App.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
using CefSharp.Example;
77
using CefSharp.Example.Handlers;
88
using CefSharp.Wpf.Example.Handlers;
9-
9+
#if CEFSHARP_WPF_HWNDHOST
10+
using CefSharp.Wpf.HwndHost;
11+
#endif
1012
namespace CefSharp.Wpf.Example
1113
{
1214
public partial class App : Application

CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@
3535
<SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained>
3636
</PropertyGroup>
3737

38+
<PropertyGroup Condition="'False'">
39+
<DefineConstants>$(DefineConstants);CEFSHARP_WPF_HWNDHOST</DefineConstants>
40+
</PropertyGroup>
3841
<ItemGroup>
3942
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.csproj" />
4043
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
41-
<ProjectReference Include="..\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj" />
4244
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
4345
<PackageReference Include="chromiumembeddedframework.runtime" Version="129.0.11" />
4446
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
@@ -49,6 +51,18 @@
4951
<PackageReference Include="MaterialDesignThemes" Version="4.8.0" />
5052
</ItemGroup>
5153

54+
<Choose>
55+
<When Condition="$(DefineConstants.Contains(CEFSHARP_WPF_HWNDHOST))">
56+
<ItemGroup>
57+
<ProjectReference Include="..\CefSharp.Wpf.HwndHost\CefSharp.Wpf.HwndHost\CefSharp.Wpf.HwndHost.csproj" />
58+
</ItemGroup>
59+
</When>
60+
<Otherwise>
61+
<ItemGroup>
62+
<ProjectReference Include="..\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj" />
63+
</ItemGroup>
64+
</Otherwise>
65+
</Choose>
5266
<ItemGroup>
5367
<None Include="crash_reporter.cfg">
5468
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

CefSharp.Wpf.Example/ChangeParentWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
44

55
using System.Windows;
6+
using CefSharp.Wpf.Example.Controls;
67

78
namespace CefSharp.Wpf.Example
89
{

CefSharp.Wpf.Example/Controls/ChromiumWebBrowserWithScreenshotSupport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public Task<InteropBitmap> TakeScreenshot(Size screenshotSize, int? frameRate =
9797

9898
return screenshotTaskCompletionSource.Task;
9999
}
100-
100+
#if ! CEFSHARP_WPF_HWNDHOST
101101
protected override CefSharp.Structs.Rect GetViewRect()
102102
{
103103
if (isTakingScreenshot)
@@ -161,7 +161,7 @@ protected override void OnPaint(bool isPopup, Structs.Rect dirtyRect, IntPtr buf
161161
base.OnPaint(isPopup, dirtyRect, buffer, width, height);
162162
}
163163
}
164-
164+
#endif
165165
private void TakeScreenshot()
166166
{
167167
var uiThreadTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();

CefSharp.Wpf.Example/Controls/NonReloadingTabControl.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
using System.Windows.Automation.Peers;
55
using System.Windows.Controls;
66
using System.Windows.Controls.Primitives;
7+
#if ! CEFSHARP_WPF_HWNDHOST
78
using TabControlAutomationPeer = CefSharp.Wpf.Experimental.Accessibility.TabControlAutomationPeer;
9+
#endif
810

911
namespace CefSharp.Wpf.Example.Controls
1012
{
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
#if CEFSHARP_WPF_HWNDHOST
7+
using CefSharp.Wpf.HwndHost;
8+
#endif
9+
namespace CefSharp.Wpf.Example.Controls
10+
{
11+
public class ChromiumWebBrowser :
12+
#if CEFSHARP_WPF_HWNDHOST
13+
CefSharp.Wpf.HwndHost.ChromiumWebBrowser
14+
#else
15+
CefSharp.Wpf.ChromiumWebBrowser
16+
#endif
17+
{
18+
public ChromiumWebBrowser(string initialAddress) : base(initialAddress){ }
19+
public ChromiumWebBrowser() { }
20+
}
21+
}

CefSharp.Wpf.Example/Handlers/DisplayHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
44

5+
using CefSharp.Wpf.Example.Controls;
56
using CefSharp.Wpf.Example.Views;
67
using System;
78
using System.Windows;

CefSharp.Wpf.Example/Handlers/JsDialogHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
44

55
using System.Windows;
6+
using CefSharp.Wpf.Example.Controls;
67

78
namespace CefSharp.Wpf.Example.Handlers
89
{

CefSharp.Wpf.Example/Handlers/MenuHandler.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
44

55
using System;
6+
#if ! CEFSHARP_WPF_HWNDHOST
67
using CefSharp.Wpf.Handler;
78

89
namespace CefSharp.Wpf.Example.Handlers
@@ -46,3 +47,5 @@ protected override void ExecuteCommand(IBrowser browser, ContextMenuExecuteModel
4647
}
4748
}
4849
}
50+
51+
#endif

0 commit comments

Comments
 (0)