Skip to content

Commit d8f684f

Browse files
committed
Move DefaultFocusHandler into it's own internal class
1 parent eab35e7 commit d8f684f

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

CefSharp.WinForms/ChromiumWebBrowser.cs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Threading.Tasks;
77
using System.Windows.Forms;
88
using CefSharp.Internals;
9+
using CefSharp.WinForms.Internals;
910

1011
namespace CefSharp.WinForms
1112
{
@@ -356,31 +357,5 @@ private void ResizeBrowser()
356357
managedCefBrowserAdapter.Resize(Width, Height);
357358
}
358359
}
359-
360-
#region DefaultFocusHandler
361-
private class DefaultFocusHandler : IFocusHandler
362-
{
363-
private ChromiumWebBrowser browser;
364-
365-
public DefaultFocusHandler(ChromiumWebBrowser browser)
366-
{
367-
this.browser = browser;
368-
}
369-
370-
public void OnGotFocus()
371-
{
372-
}
373-
374-
public bool OnSetFocus(CefFocusSource source)
375-
{
376-
return false;
377-
}
378-
379-
public void OnTakeFocus(bool next)
380-
{
381-
browser.BeginInvoke(new MethodInvoker(() => browser.SelectNextControl(browser, next, true, true, true)));
382-
}
383-
}
384-
#endregion
385360
}
386361
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Windows.Forms;
2+
3+
namespace CefSharp.WinForms.Internals
4+
{
5+
internal class DefaultFocusHandler : IFocusHandler
6+
{
7+
private readonly ChromiumWebBrowser browser;
8+
9+
public DefaultFocusHandler(ChromiumWebBrowser browser)
10+
{
11+
this.browser = browser;
12+
}
13+
14+
public void OnGotFocus()
15+
{
16+
}
17+
18+
public bool OnSetFocus(CefFocusSource source)
19+
{
20+
return false;
21+
}
22+
23+
public void OnTakeFocus(bool next)
24+
{
25+
browser.BeginInvoke(new MethodInvoker(() => browser.SelectNextControl(browser, next, true, true, true)));
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)