Skip to content

Commit 6b682d6

Browse files
committed
WinForms/Wpf.HwndHost - Add CefSharpSettings.RuntimeStyle
- Allow for configuring of the CEF RuntimeStyle globally. Issue #4835
1 parent 43321f7 commit 6b682d6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CefSharp.WinForms/ChromiumWebBrowser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ private void OnHandleDestroyedInternal()
657657
protected virtual IWindowInfo CreateBrowserWindowInfo(IntPtr handle)
658658
{
659659
var windowInfo = Core.ObjectFactory.CreateWindowInfo();
660-
windowInfo.RuntimeStyle = CefRuntimeStyle.Alloy;
660+
windowInfo.RuntimeStyle = CefSharpSettings.RuntimeStyle ?? CefRuntimeStyle.Alloy;
661661
windowInfo.SetAsChild(handle);
662662

663663
if (!ActivateBrowserOnCreation)

CefSharp/CefSharpSettings.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,19 @@ static CefSharpSettings()
8181
/// false.
8282
/// </summary>
8383
public static bool FocusedNodeChangedEnabled { get; set; }
84+
85+
/// <summary>
86+
/// CefSharp.WinForms and CefSharp.Wpf.HwndHost ONLY!
87+
/// The default is to create <see cref="CefRuntimeStyle.Alloy"/>
88+
/// styled browsers, those wanting to use <see cref="CefRuntimeStyle.Chrome"/>
89+
/// styled browsers can set this property.
90+
/// </summary>
91+
/// <remarks>
92+
/// Sets the <see cref="IWindowInfo.RuntimeStyle"/> property.
93+
/// You can customise this yourself on a per browser basis
94+
/// by overriding the ChromiumWebBrowser.CreateBrowserWindowInfo
95+
/// property.
96+
/// </remarks>
97+
public static CefRuntimeStyle? RuntimeStyle { get; set; }
8498
}
8599
}

0 commit comments

Comments
 (0)