Skip to content

Commit ac7f3dd

Browse files
committed
Extracted ISchemeHandler into a file of its own, according to the "one file per class/type" pattern which is generally preferable.
1 parent 10bc4b2 commit ac7f3dd

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

CefSharp/CefSharp.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
<ClInclude Include="IRenderWebBrowser.h" />
163163
<ClInclude Include="IRequest.h" />
164164
<ClInclude Include="IRequestHandler.h" />
165+
<ClInclude Include="ISchemeHandler.h" />
165166
<ClInclude Include="IWebBrowser.h" />
166167
<ClInclude Include="LoadCompletedEventArgs.h" />
167168
<ClInclude Include="MCefRefPtr.h" />

CefSharp/CefSharp.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,8 @@
187187
<ClInclude Include="SchemeHandlerResponse.h">
188188
<Filter>Header Files</Filter>
189189
</ClInclude>
190+
<ClInclude Include="ISchemeHandler.h">
191+
<Filter>Header Files</Filter>
192+
</ClInclude>
190193
</ItemGroup>
191194
</Project>

CefSharp/ISchemeHandler.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "Stdafx.h"
2+
#include "Request.h"
3+
4+
namespace CefSharp
5+
{
6+
ref class SchemeHandlerResponse;
7+
public delegate void OnRequestCompletedHandler();
8+
9+
public interface class ISchemeHandler
10+
{
11+
/// <summary>
12+
/// Processes a custom scheme-based request asynchronously. The implementing method should call the callback whenever the
13+
/// request is completed.
14+
/// </summary>
15+
/// <returns>true if the request is handled, false otherwise.</returns>
16+
bool ProcessRequestAsync(IRequest^ request, SchemeHandlerResponse^ response, OnRequestCompletedHandler^ callback);
17+
};
18+
}

CefSharp/SchemeHandlerWrapper.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "include/cef_scheme.h"
55
#include "Request.h"
6+
#include "ISchemeHandler.h"
67

78
using namespace System;
89
using namespace System::IO;
@@ -11,18 +12,6 @@ namespace CefSharp
1112
{
1213
ref class SchemeHandlerResponse;
1314

14-
public delegate void OnRequestCompletedHandler();
15-
16-
public interface class ISchemeHandler
17-
{
18-
/// <summary>
19-
/// Processes a custom scheme-based request asynchronously. The implementing method should call the callback whenever the
20-
/// request is completed.
21-
/// </summary>
22-
/// <returns>true if the request is handled, false otherwise.</returns>
23-
bool ProcessRequestAsync(IRequest^ request, SchemeHandlerResponse^ response, OnRequestCompletedHandler^ callback);
24-
};
25-
2615
public interface class ISchemeHandlerFactory
2716
{
2817
ISchemeHandler^ Create();

0 commit comments

Comments
 (0)