Browse Source

Base for web allowed object implemented c++/winrt

Tero Paananen 4 years ago
parent
commit
c5157df10e

+ 19
- 19
example/windows/WebViewWindows.sln View File

@@ -42,7 +42,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mso", "..\..\node_modules\r
42 42
 EndProject
43 43
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeWebView", "..\..\windows\ReactNativeWebView\ReactNativeWebView.vcxproj", "{729D9AF8-CD9E-4427-9F6C-FB757E287729}"
44 44
 EndProject
45
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebViewBridge", "..\..\windows\WebViewBridge\WebViewBridge.vcxproj", "{DC466263-7D1F-4907-ACD1-CC771D1FDD58}"
45
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebViewBridgeComponent", "..\..\windows\WebViewBridgeComponent\WebViewBridgeComponent.vcxproj", "{FCB612AD-FACC-410C-828C-24B5940B2762}"
46 46
 EndProject
47 47
 Global
48 48
 	GlobalSection(SharedMSBuildProjectFiles) = preSolution
@@ -225,24 +225,24 @@ Global
225 225
 		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x64.Build.0 = Release|x64
226 226
 		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x86.ActiveCfg = Release|Win32
227 227
 		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x86.Build.0 = Release|Win32
228
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|Any CPU.ActiveCfg = Debug|Win32
229
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|ARM.ActiveCfg = Debug|ARM
230
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|ARM.Build.0 = Debug|ARM
231
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|ARM64.ActiveCfg = Debug|ARM64
232
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|ARM64.Build.0 = Debug|ARM64
233
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|x64.ActiveCfg = Debug|x64
234
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|x64.Build.0 = Debug|x64
235
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|x86.ActiveCfg = Debug|Win32
236
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|x86.Build.0 = Debug|Win32
237
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|Any CPU.ActiveCfg = Release|Win32
238
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|ARM.ActiveCfg = Release|ARM
239
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|ARM.Build.0 = Release|ARM
240
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|ARM64.ActiveCfg = Release|ARM64
241
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|ARM64.Build.0 = Release|ARM64
242
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|x64.ActiveCfg = Release|x64
243
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|x64.Build.0 = Release|x64
244
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|x86.ActiveCfg = Release|Win32
245
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|x86.Build.0 = Release|Win32
228
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|Any CPU.ActiveCfg = Debug|Win32
229
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|ARM.ActiveCfg = Debug|ARM
230
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|ARM.Build.0 = Debug|ARM
231
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|ARM64.ActiveCfg = Debug|ARM64
232
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|ARM64.Build.0 = Debug|ARM64
233
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|x64.ActiveCfg = Debug|x64
234
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|x64.Build.0 = Debug|x64
235
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|x86.ActiveCfg = Debug|Win32
236
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|x86.Build.0 = Debug|Win32
237
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|Any CPU.ActiveCfg = Release|Win32
238
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|ARM.ActiveCfg = Release|ARM
239
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|ARM.Build.0 = Release|ARM
240
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|ARM64.ActiveCfg = Release|ARM64
241
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|ARM64.Build.0 = Release|ARM64
242
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|x64.ActiveCfg = Release|x64
243
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|x64.Build.0 = Release|x64
244
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|x86.ActiveCfg = Release|Win32
245
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|x86.Build.0 = Release|Win32
246 246
 	EndGlobalSection
247 247
 	GlobalSection(SolutionProperties) = preSolution
248 248
 		HideSolutionNode = FALSE

+ 17
- 17
windows/ReactNativeWebView.sln View File

@@ -29,7 +29,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactUWP", "..\node_modules
29 29
 EndProject
30 30
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactWindowsCore", "..\node_modules\react-native-windows\ReactWindowsCore\ReactWindowsCore.vcxproj", "{11C084A3-A57C-4296-A679-CAC17B603144}"
31 31
 EndProject
32
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebViewBridge", "WebViewBridge\WebViewBridge.vcxproj", "{DC466263-7D1F-4907-ACD1-CC771D1FDD58}"
32
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebViewBridgeComponent", "WebViewBridgeComponent\WebViewBridgeComponent.vcxproj", "{FCB612AD-FACC-410C-828C-24B5940B2762}"
33 33
 EndProject
34 34
 Global
35 35
 	GlobalSection(SharedMSBuildProjectFiles) = preSolution
@@ -186,22 +186,22 @@ Global
186 186
 		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x64.Build.0 = Release|x64
187 187
 		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x86.ActiveCfg = Release|Win32
188 188
 		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x86.Build.0 = Release|Win32
189
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|ARM.ActiveCfg = Debug|ARM
190
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|ARM.Build.0 = Debug|ARM
191
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|ARM64.ActiveCfg = Debug|ARM64
192
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|ARM64.Build.0 = Debug|ARM64
193
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|x64.ActiveCfg = Debug|x64
194
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|x64.Build.0 = Debug|x64
195
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|x86.ActiveCfg = Debug|Win32
196
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Debug|x86.Build.0 = Debug|Win32
197
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|ARM.ActiveCfg = Release|ARM
198
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|ARM.Build.0 = Release|ARM
199
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|ARM64.ActiveCfg = Release|ARM64
200
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|ARM64.Build.0 = Release|ARM64
201
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|x64.ActiveCfg = Release|x64
202
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|x64.Build.0 = Release|x64
203
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|x86.ActiveCfg = Release|Win32
204
-		{DC466263-7D1F-4907-ACD1-CC771D1FDD58}.Release|x86.Build.0 = Release|Win32
189
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|ARM.ActiveCfg = Debug|ARM
190
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|ARM.Build.0 = Debug|ARM
191
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|ARM64.ActiveCfg = Debug|ARM64
192
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|ARM64.Build.0 = Debug|ARM64
193
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|x64.ActiveCfg = Debug|x64
194
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|x64.Build.0 = Debug|x64
195
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|x86.ActiveCfg = Debug|Win32
196
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Debug|x86.Build.0 = Debug|Win32
197
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|ARM.ActiveCfg = Release|ARM
198
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|ARM.Build.0 = Release|ARM
199
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|ARM64.ActiveCfg = Release|ARM64
200
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|ARM64.Build.0 = Release|ARM64
201
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|x64.ActiveCfg = Release|x64
202
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|x64.Build.0 = Release|x64
203
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|x86.ActiveCfg = Release|Win32
204
+		{FCB612AD-FACC-410C-828C-24B5940B2762}.Release|x86.Build.0 = Release|Win32
205 205
 	EndGlobalSection
206 206
 	GlobalSection(SolutionProperties) = preSolution
207 207
 		HideSolutionNode = FALSE

+ 2
- 2
windows/ReactNativeWebView/ReactNativeWebView.vcxproj View File

@@ -145,8 +145,8 @@
145 145
       <Project>{f7d32bd0-2749-483e-9a0d-1635ef7e3136}</Project>
146 146
       <Private>false</Private>
147 147
     </ProjectReference>
148
-    <ProjectReference Include="..\WebViewBridge\WebViewBridge.vcxproj">
149
-      <Project>{dc466263-7d1f-4907-acd1-cc771d1fdd58}</Project>
148
+    <ProjectReference Include="..\WebViewBridgeComponent\WebViewBridgeComponent.vcxproj">
149
+      <Project>{fcb612ad-facc-410c-828c-24b5940b2762}</Project>
150 150
     </ProjectReference>
151 151
   </ItemGroup>
152 152
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 6
- 1
windows/ReactNativeWebView/ReactWebView.cpp View File

@@ -35,7 +35,7 @@ namespace winrt::ReactNativeWebView::implementation {
35 35
     ReactWebView::~ReactWebView()
36 36
     {
37 37
       if (m_messagingEnabled) {
38
-        m_webBridge.MessagePostedEvent(m_message_token);
38
+        //m_webBridge.MessagePostedEvent(m_message_token);
39 39
       }
40 40
     }
41 41
 
@@ -87,11 +87,16 @@ namespace winrt::ReactNativeWebView::implementation {
87 87
 
88 88
         if (m_messagingEnabled) {
89 89
           auto tag = this->GetValue(winrt::FrameworkElement::TagProperty()).as<winrt::IPropertyValue>().GetInt64();
90
+          /*
90 91
           m_webBridge = WebViewBridge::WebBridge(tag);
91 92
           m_message_token = m_webBridge.MessagePostedEvent([this](hstring const& message) {
92 93
             this->OnMessagePosted(message);
93 94
           });
94 95
           webView.AddWebAllowedObject(L"__REACT_WEB_VIEW_BRIDGE", m_webBridge);
96
+          */
97
+
98
+          m_webBridge = WebBridge();
99
+          webView.AddWebAllowedObject(L"__REACT_WEB_VIEW_BRIDGE", m_webBridge);
95 100
         }
96 101
     }
97 102
 

+ 4
- 2
windows/ReactNativeWebView/ReactWebView.h View File

@@ -7,7 +7,9 @@
7 7
 #include "NativeModules.h"
8 8
 #include "ReactWebView.g.h"
9 9
 
10
-#include "winrt/WebViewBridge.h"
10
+#include "winrt/WebViewBridgeComponent.h"
11
+
12
+using namespace winrt::WebViewBridgeComponent;
11 13
 
12 14
 namespace winrt::ReactNativeWebView::implementation {
13 15
 
@@ -22,7 +24,7 @@ namespace winrt::ReactNativeWebView::implementation {
22 24
         bool m_messagingEnabled{ true };
23 25
         winrt::Windows::UI::Xaml::Controls::WebView m_webView{ nullptr };
24 26
         Microsoft::ReactNative::IReactContext m_reactContext{ nullptr };
25
-        WebViewBridge::WebBridge m_webBridge{ nullptr };
27
+        WebBridge m_webBridge{ nullptr };
26 28
         winrt::event_token m_message_token;
27 29
         winrt::Windows::UI::Xaml::Controls::WebView::NavigationStarting_revoker m_navigationStartingRevoker{};
28 30
         winrt::Windows::UI::Xaml::Controls::WebView::NavigationCompleted_revoker m_navigationCompletedRevoker{};

+ 0
- 25
windows/WebViewBridge/WebBridge.cpp View File

@@ -1,25 +0,0 @@
1
-#include "pch.h"
2
-#include "WebBridge.h"
3
-
4
-
5
-
6
-using namespace WebViewBridge;
7
-using namespace Platform;
8
-
9
-using namespace Windows::UI::Core;
10
-
11
-WebBridge::WebBridge(int64 tag)
12
-{
13
-  m_tag = tag;
14
-  // Must run on App UI thread
15
-  m_dispatcher = Windows::UI::Core::CoreWindow::GetForCurrentThread()->Dispatcher;
16
-}
17
-
18
-void WebBridge::PostMessage(Platform::String^ message) {
19
-  m_dispatcher->RunAsync(
20
-    CoreDispatcherPriority::Normal,
21
-    ref new DispatchedHandler([this, message]
22
-      {
23
-        MessagePostedEvent(message);
24
-      }));
25
-}

+ 0
- 20
windows/WebViewBridge/WebBridge.h View File

@@ -1,20 +0,0 @@
1
-#pragma once
2
-
3
-using namespace Windows::Foundation;
4
-
5
-namespace WebViewBridge
6
-{
7
-  public delegate void MessagePosted(Platform::String^ message);
8
-
9
-  [Windows::Foundation::Metadata::AllowForWebAttribute]
10
-  public ref class WebBridge sealed
11
-    {
12
-    public:
13
-      WebBridge(int64 tag);
14
-      void PostMessage(Platform::String^ message);
15
-      event MessagePosted^ MessagePostedEvent;
16
-    private:
17
-      Windows::UI::Core::CoreDispatcher^ m_dispatcher;
18
-      int64 m_tag;
19
-    };
20
-}

+ 0
- 289
windows/WebViewBridge/WebViewBridge.vcxproj View File

@@ -1,289 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
-  <ItemGroup Label="ProjectConfigurations">
4
-    <ProjectConfiguration Include="Debug|ARM">
5
-      <Configuration>Debug</Configuration>
6
-      <Platform>ARM</Platform>
7
-    </ProjectConfiguration>
8
-    <ProjectConfiguration Include="Debug|ARM64">
9
-      <Configuration>Debug</Configuration>
10
-      <Platform>ARM64</Platform>
11
-    </ProjectConfiguration>
12
-    <ProjectConfiguration Include="Debug|Win32">
13
-      <Configuration>Debug</Configuration>
14
-      <Platform>Win32</Platform>
15
-    </ProjectConfiguration>
16
-    <ProjectConfiguration Include="Debug|x64">
17
-      <Configuration>Debug</Configuration>
18
-      <Platform>x64</Platform>
19
-    </ProjectConfiguration>
20
-    <ProjectConfiguration Include="Release|ARM">
21
-      <Configuration>Release</Configuration>
22
-      <Platform>ARM</Platform>
23
-    </ProjectConfiguration>
24
-    <ProjectConfiguration Include="Release|ARM64">
25
-      <Configuration>Release</Configuration>
26
-      <Platform>ARM64</Platform>
27
-    </ProjectConfiguration>
28
-    <ProjectConfiguration Include="Release|Win32">
29
-      <Configuration>Release</Configuration>
30
-      <Platform>Win32</Platform>
31
-    </ProjectConfiguration>
32
-    <ProjectConfiguration Include="Release|x64">
33
-      <Configuration>Release</Configuration>
34
-      <Platform>x64</Platform>
35
-    </ProjectConfiguration>
36
-  </ItemGroup>
37
-  <PropertyGroup Label="Globals">
38
-    <ProjectGuid>{dc466263-7d1f-4907-acd1-cc771d1fdd58}</ProjectGuid>
39
-    <Keyword>WindowsRuntimeComponent</Keyword>
40
-    <RootNamespace>WebViewBridge</RootNamespace>
41
-    <DefaultLanguage>en-US</DefaultLanguage>
42
-    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
43
-    <AppContainerApplication>true</AppContainerApplication>
44
-    <ApplicationType>Windows Store</ApplicationType>
45
-    <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
46
-    <WindowsTargetPlatformMinVersion>10.0.14393.0</WindowsTargetPlatformMinVersion>
47
-    <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
48
-  </PropertyGroup>
49
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
50
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
51
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
52
-    <UseDebugLibraries>true</UseDebugLibraries>
53
-    <PlatformToolset>v142</PlatformToolset>
54
-  </PropertyGroup>
55
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
56
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
57
-    <UseDebugLibraries>true</UseDebugLibraries>
58
-    <PlatformToolset>v142</PlatformToolset>
59
-  </PropertyGroup>
60
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
61
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
62
-    <UseDebugLibraries>true</UseDebugLibraries>
63
-    <PlatformToolset>v142</PlatformToolset>
64
-  </PropertyGroup>
65
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
66
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
67
-    <UseDebugLibraries>true</UseDebugLibraries>
68
-    <PlatformToolset>v142</PlatformToolset>
69
-  </PropertyGroup>
70
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
71
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
72
-    <UseDebugLibraries>false</UseDebugLibraries>
73
-    <WholeProgramOptimization>true</WholeProgramOptimization>
74
-    <PlatformToolset>v142</PlatformToolset>
75
-  </PropertyGroup>
76
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
77
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
78
-    <UseDebugLibraries>false</UseDebugLibraries>
79
-    <WholeProgramOptimization>true</WholeProgramOptimization>
80
-    <PlatformToolset>v142</PlatformToolset>
81
-  </PropertyGroup>
82
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
83
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
84
-    <UseDebugLibraries>false</UseDebugLibraries>
85
-    <WholeProgramOptimization>true</WholeProgramOptimization>
86
-    <PlatformToolset>v142</PlatformToolset>
87
-  </PropertyGroup>
88
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
89
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
90
-    <UseDebugLibraries>false</UseDebugLibraries>
91
-    <WholeProgramOptimization>true</WholeProgramOptimization>
92
-    <PlatformToolset>v142</PlatformToolset>
93
-  </PropertyGroup>
94
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
95
-  <ImportGroup Label="ExtensionSettings">
96
-  </ImportGroup>
97
-  <ImportGroup Label="Shared">
98
-  </ImportGroup>
99
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
100
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
101
-  </ImportGroup>
102
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
103
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
104
-  </ImportGroup>
105
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
106
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
107
-  </ImportGroup>
108
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
109
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
110
-  </ImportGroup>
111
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
112
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
113
-  </ImportGroup>
114
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
115
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
116
-  </ImportGroup>
117
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
118
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
119
-  </ImportGroup>
120
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
121
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
122
-  </ImportGroup>
123
-  <PropertyGroup Label="UserMacros" />
124
-  <PropertyGroup />
125
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
126
-    <GenerateManifest>false</GenerateManifest>
127
-  </PropertyGroup>
128
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
129
-    <GenerateManifest>false</GenerateManifest>
130
-  </PropertyGroup>
131
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
132
-    <GenerateManifest>false</GenerateManifest>
133
-  </PropertyGroup>
134
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
135
-    <GenerateManifest>false</GenerateManifest>
136
-  </PropertyGroup>
137
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
138
-    <GenerateManifest>false</GenerateManifest>
139
-  </PropertyGroup>
140
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
141
-    <GenerateManifest>false</GenerateManifest>
142
-  </PropertyGroup>
143
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
144
-    <GenerateManifest>false</GenerateManifest>
145
-  </PropertyGroup>
146
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
147
-    <GenerateManifest>false</GenerateManifest>
148
-  </PropertyGroup>
149
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
150
-    <ClCompile>
151
-      <PrecompiledHeader>Use</PrecompiledHeader>
152
-      <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
153
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
154
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
155
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
156
-      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
157
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
158
-    </ClCompile>
159
-    <Link>
160
-      <SubSystem>Console</SubSystem>
161
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
162
-    </Link>
163
-  </ItemDefinitionGroup>
164
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
165
-    <ClCompile>
166
-      <PrecompiledHeader>Use</PrecompiledHeader>
167
-      <PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
168
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
169
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
170
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
171
-      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
172
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
173
-    </ClCompile>
174
-    <Link>
175
-      <SubSystem>Console</SubSystem>
176
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
177
-    </Link>
178
-  </ItemDefinitionGroup>
179
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
180
-    <ClCompile>
181
-      <PrecompiledHeader>Use</PrecompiledHeader>
182
-      <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
183
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
184
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
185
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
186
-      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
187
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
188
-    </ClCompile>
189
-    <Link>
190
-      <SubSystem>Console</SubSystem>
191
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
192
-    </Link>
193
-  </ItemDefinitionGroup>
194
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
195
-    <ClCompile>
196
-      <PrecompiledHeader>Use</PrecompiledHeader>
197
-      <PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
198
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
199
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
200
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
201
-      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
202
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
203
-    </ClCompile>
204
-    <Link>
205
-      <SubSystem>Console</SubSystem>
206
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
207
-    </Link>
208
-  </ItemDefinitionGroup>
209
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
210
-    <ClCompile>
211
-      <PrecompiledHeader>Use</PrecompiledHeader>
212
-      <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
213
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
214
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
215
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
216
-      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
217
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
218
-    </ClCompile>
219
-    <Link>
220
-      <SubSystem>Console</SubSystem>
221
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
222
-    </Link>
223
-  </ItemDefinitionGroup>
224
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
225
-    <ClCompile>
226
-      <PrecompiledHeader>Use</PrecompiledHeader>
227
-      <PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
228
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
229
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
230
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
231
-      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
232
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
233
-    </ClCompile>
234
-    <Link>
235
-      <SubSystem>Console</SubSystem>
236
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
237
-    </Link>
238
-  </ItemDefinitionGroup>
239
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
240
-    <ClCompile>
241
-      <PrecompiledHeader>Use</PrecompiledHeader>
242
-      <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
243
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
244
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
245
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
246
-      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
247
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
248
-    </ClCompile>
249
-    <Link>
250
-      <SubSystem>Console</SubSystem>
251
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
252
-    </Link>
253
-  </ItemDefinitionGroup>
254
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
255
-    <ClCompile>
256
-      <PrecompiledHeader>Use</PrecompiledHeader>
257
-      <PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
258
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
259
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
260
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
261
-      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
262
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
263
-    </ClCompile>
264
-    <Link>
265
-      <SubSystem>Console</SubSystem>
266
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
267
-    </Link>
268
-  </ItemDefinitionGroup>
269
-  <ItemGroup>
270
-    <ClInclude Include="pch.h" />
271
-    <ClInclude Include="WebBridge.h" />
272
-  </ItemGroup>
273
-  <ItemGroup>
274
-    <ClCompile Include="pch.cpp">
275
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
276
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
277
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
278
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
279
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
280
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
281
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
282
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
283
-    </ClCompile>
284
-    <ClCompile Include="WebBridge.cpp" />
285
-  </ItemGroup>
286
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
287
-  <ImportGroup Label="ExtensionTargets">
288
-  </ImportGroup>
289
-</Project>

+ 0
- 17
windows/WebViewBridge/WebViewBridge.vcxproj.filters View File

@@ -1,17 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
-  <ItemGroup>
4
-    <Filter Include="Resources">
5
-      <UniqueIdentifier>956acc86-f096-4dd3-8011-069df633f74e</UniqueIdentifier>
6
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
7
-    </Filter>
8
-  </ItemGroup>
9
-  <ItemGroup>
10
-    <ClCompile Include="pch.cpp" />
11
-    <ClCompile Include="WebBridge.cpp" />
12
-  </ItemGroup>
13
-  <ItemGroup>
14
-    <ClInclude Include="pch.h" />
15
-    <ClInclude Include="WebBridge.h" />
16
-  </ItemGroup>
17
-</Project>

+ 0
- 4
windows/WebViewBridge/pch.h View File

@@ -1,4 +0,0 @@
1
-#pragma once
2
-
3
-#include <collection.h>
4
-#include <ppltasks.h>

+ 16
- 0
windows/WebViewBridgeComponent/PropertySheet.props View File

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <ImportGroup Label="PropertySheets" />
4
+  <PropertyGroup Label="UserMacros" />
5
+  <!--
6
+    To customize common C++/WinRT project properties: 
7
+    * right-click the project node
8
+    * expand the Common Properties item
9
+    * select the C++/WinRT property page
10
+
11
+    For more advanced scenarios, and complete documentation, please see:
12
+    https://github.com/Microsoft/cppwinrt/tree/master/nuget 
13
+    -->
14
+  <PropertyGroup />
15
+  <ItemDefinitionGroup />
16
+</Project>

+ 8
- 0
windows/WebViewBridgeComponent/WebBridge.cpp View File

@@ -0,0 +1,8 @@
1
+#include "pch.h"
2
+#include "WebBridge.h"
3
+#include "WebBridge.g.cpp"
4
+
5
+namespace winrt::WebViewBridgeComponent::implementation
6
+{
7
+  
8
+}

+ 18
- 0
windows/WebViewBridgeComponent/WebBridge.h View File

@@ -0,0 +1,18 @@
1
+#pragma once
2
+
3
+#include "WebBridge.g.h"
4
+
5
+namespace winrt::WebViewBridgeComponent::implementation
6
+{
7
+    struct WebBridge : WebBridgeT<WebBridge>
8
+    {
9
+      WebBridge() = default;
10
+    };
11
+}
12
+
13
+namespace winrt::WebViewBridgeComponent::factory_implementation
14
+{
15
+    struct WebBridge : WebBridgeT<WebBridge, implementation::WebBridge>
16
+    {
17
+    };
18
+}

+ 9
- 0
windows/WebViewBridgeComponent/WebBridge.idl View File

@@ -0,0 +1,9 @@
1
+namespace WebViewBridgeComponent
2
+{
3
+    [default_interface]
4
+    [allowforweb]
5
+    runtimeclass WebBridge
6
+    {
7
+        WebBridge();
8
+    }
9
+}

+ 3
- 0
windows/WebViewBridgeComponent/WebViewBridgeComponent.def View File

@@ -0,0 +1,3 @@
1
+EXPORTS
2
+DllCanUnloadNow = WINRT_CanUnloadNow                    PRIVATE
3
+DllGetActivationFactory = WINRT_GetActivationFactory    PRIVATE

+ 158
- 0
windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj View File

@@ -0,0 +1,158 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props')" />
4
+  <PropertyGroup Label="Globals">
5
+    <CppWinRTOptimized>true</CppWinRTOptimized>
6
+    <CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
7
+    <CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
8
+    <MinimalCoreWin>true</MinimalCoreWin>
9
+    <ProjectGuid>{fcb612ad-facc-410c-828c-24b5940b2762}</ProjectGuid>
10
+    <ProjectName>WebViewBridgeComponent</ProjectName>
11
+    <RootNamespace>WebViewBridgeComponent</RootNamespace>
12
+    <DefaultLanguage>en-US</DefaultLanguage>
13
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
14
+    <AppContainerApplication>true</AppContainerApplication>
15
+    <ApplicationType>Windows Store</ApplicationType>
16
+    <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
17
+    <WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
18
+    <WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
19
+  </PropertyGroup>
20
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
21
+  <ItemGroup Label="ProjectConfigurations">
22
+    <ProjectConfiguration Include="Debug|ARM">
23
+      <Configuration>Debug</Configuration>
24
+      <Platform>ARM</Platform>
25
+    </ProjectConfiguration>
26
+    <ProjectConfiguration Include="Debug|ARM64">
27
+      <Configuration>Debug</Configuration>
28
+      <Platform>ARM64</Platform>
29
+    </ProjectConfiguration>
30
+    <ProjectConfiguration Include="Debug|Win32">
31
+      <Configuration>Debug</Configuration>
32
+      <Platform>Win32</Platform>
33
+    </ProjectConfiguration>
34
+    <ProjectConfiguration Include="Debug|x64">
35
+      <Configuration>Debug</Configuration>
36
+      <Platform>x64</Platform>
37
+    </ProjectConfiguration>
38
+    <ProjectConfiguration Include="Release|ARM">
39
+      <Configuration>Release</Configuration>
40
+      <Platform>ARM</Platform>
41
+    </ProjectConfiguration>
42
+    <ProjectConfiguration Include="Release|ARM64">
43
+      <Configuration>Release</Configuration>
44
+      <Platform>ARM64</Platform>
45
+    </ProjectConfiguration>
46
+    <ProjectConfiguration Include="Release|Win32">
47
+      <Configuration>Release</Configuration>
48
+      <Platform>Win32</Platform>
49
+    </ProjectConfiguration>
50
+    <ProjectConfiguration Include="Release|x64">
51
+      <Configuration>Release</Configuration>
52
+      <Platform>x64</Platform>
53
+    </ProjectConfiguration>
54
+  </ItemGroup>
55
+  <PropertyGroup Label="Configuration">
56
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
57
+    <PlatformToolset>v140</PlatformToolset>
58
+    <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
59
+    <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
60
+    <CharacterSet>Unicode</CharacterSet>
61
+    <GenerateManifest>false</GenerateManifest>
62
+  </PropertyGroup>
63
+  <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
64
+    <UseDebugLibraries>true</UseDebugLibraries>
65
+    <LinkIncremental>true</LinkIncremental>
66
+  </PropertyGroup>
67
+  <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
68
+    <UseDebugLibraries>false</UseDebugLibraries>
69
+    <WholeProgramOptimization>true</WholeProgramOptimization>
70
+    <LinkIncremental>false</LinkIncremental>
71
+  </PropertyGroup>
72
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
73
+  <ImportGroup Label="ExtensionSettings">
74
+  </ImportGroup>
75
+  <ImportGroup Label="Shared">
76
+  </ImportGroup>
77
+  <ImportGroup Label="PropertySheets">
78
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
79
+  </ImportGroup>
80
+  <ImportGroup Label="PropertySheets">
81
+    <Import Project="PropertySheet.props" />
82
+  </ImportGroup>
83
+  <PropertyGroup Label="UserMacros" />
84
+  <PropertyGroup />
85
+  <ItemDefinitionGroup>
86
+    <ClCompile>
87
+      <PrecompiledHeader>Use</PrecompiledHeader>
88
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
89
+      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
90
+      <WarningLevel>Level4</WarningLevel>
91
+      <AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
92
+      <!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
93
+      <AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
94
+      <DisableSpecificWarnings>
95
+      </DisableSpecificWarnings>
96
+      <PreprocessorDefinitions>_WINRT_DLL;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
97
+      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
98
+    </ClCompile>
99
+    <Link>
100
+      <SubSystem>Console</SubSystem>
101
+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
102
+      <ModuleDefinitionFile>WebViewBridgeComponent.def</ModuleDefinitionFile>
103
+    </Link>
104
+  </ItemDefinitionGroup>
105
+  <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
106
+    <ClCompile>
107
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
108
+    </ClCompile>
109
+  </ItemDefinitionGroup>
110
+  <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
111
+    <ClCompile>
112
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
113
+    </ClCompile>
114
+    <Link>
115
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
116
+      <OptimizeReferences>true</OptimizeReferences>
117
+    </Link>
118
+  </ItemDefinitionGroup>
119
+  <ItemGroup>
120
+    <ClInclude Include="pch.h" />
121
+    <ClInclude Include="WebBridge.h">
122
+      <DependentUpon>WebBridge.idl</DependentUpon>
123
+    </ClInclude>
124
+  </ItemGroup>
125
+  <ItemGroup>
126
+    <ClCompile Include="pch.cpp">
127
+      <PrecompiledHeader>Create</PrecompiledHeader>
128
+    </ClCompile>
129
+    <ClCompile Include="WebBridge.cpp">
130
+      <DependentUpon>WebBridge.idl</DependentUpon>
131
+    </ClCompile>
132
+    <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
133
+  </ItemGroup>
134
+  <ItemGroup>
135
+    <Midl Include="WebBridge.idl" />
136
+  </ItemGroup>
137
+  <ItemGroup>
138
+    <None Include="packages.config" />
139
+    <None Include="WebViewBridgeComponent.def" />
140
+  </ItemGroup>
141
+  <ItemGroup>
142
+    <None Include="PropertySheet.props" />
143
+    <Text Include="readme.txt">
144
+      <DeploymentContent>false</DeploymentContent>
145
+    </Text>
146
+  </ItemGroup>
147
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
148
+  <ImportGroup Label="ExtensionTargets">
149
+    <Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
150
+  </ImportGroup>
151
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
152
+    <PropertyGroup>
153
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
154
+    </PropertyGroup>
155
+    <Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props'))" />
156
+    <Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets'))" />
157
+  </Target>
158
+</Project>

+ 33
- 0
windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj.filters View File

@@ -0,0 +1,33 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <ItemGroup>
4
+    <Filter Include="Resources">
5
+      <UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
6
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
7
+    </Filter>
8
+    <Filter Include="Generated Files">
9
+      <UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
10
+    </Filter>
11
+  </ItemGroup>
12
+  <ItemGroup>
13
+    <ClCompile Include="pch.cpp" />
14
+    <ClCompile Include="Class.cpp" />
15
+    <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
16
+  </ItemGroup>
17
+  <ItemGroup>
18
+    <ClInclude Include="pch.h" />
19
+  </ItemGroup>
20
+  <ItemGroup>
21
+    <None Include="WebViewBridgeComponent.def" />
22
+    <None Include="packages.config" />
23
+  </ItemGroup>
24
+  <ItemGroup>
25
+    <None Include="PropertySheet.props" />
26
+  </ItemGroup>
27
+  <ItemGroup>
28
+    <Text Include="readme.txt" />
29
+  </ItemGroup>
30
+  <ItemGroup>
31
+    <Midl Include="WebBridge.idl" />
32
+  </ItemGroup>
33
+</Project>

+ 4
- 0
windows/WebViewBridgeComponent/packages.config View File

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+  <package id="Microsoft.Windows.CppWinRT" version="2.0.200729.8" targetFramework="native" />
4
+</packages>

windows/WebViewBridge/pch.cpp → windows/WebViewBridgeComponent/pch.cpp View File


+ 4
- 0
windows/WebViewBridgeComponent/pch.h View File

@@ -0,0 +1,4 @@
1
+#pragma once
2
+#include <unknwn.h>
3
+#include <winrt/Windows.Foundation.h>
4
+#include <winrt/Windows.Foundation.Collections.h>

+ 23
- 0
windows/WebViewBridgeComponent/readme.txt View File

@@ -0,0 +1,23 @@
1
+========================================================================
2
+    C++/WinRT WebViewBridgeComponent Project Overview
3
+========================================================================
4
+
5
+This project demonstrates how to get started authoring Windows Runtime 
6
+classes directly with standard C++, using the C++/WinRT SDK component 
7
+to generate implementation headers from interface (IDL) files.  The
8
+generated Windows Runtime component binary and WinMD files should then
9
+be bundled with the Universal Windows Platform (UWP) app consuming them.
10
+
11
+Steps:
12
+1. Create an interface (IDL) file to define your Windows Runtime class, 
13
+    its default interface, and any other interfaces it implements.
14
+2. Build the project once to generate module.g.cpp, module.h.cpp, and
15
+    implementation templates under the "Generated Files" folder, as 
16
+    well as skeleton class definitions under "Generated Files\sources".  
17
+3. Use the skeleton class definitions for reference to implement your
18
+    Windows Runtime classes.
19
+
20
+========================================================================
21
+Learn more about C++/WinRT here:
22
+http://aka.ms/cppwinrt/
23
+========================================================================