@@ -77,11 +77,32 @@ data storage etc., to help you build a more wonderful experience for your applic
7777## Win32 C++
7878
7979``` IDL
80- interface ICoreWebView2_7;
8180interface ICoreWebView2ControllerOptions;
8281interface ICoreWebView2Environment5;
82+ interface ICoreWebView2_7;
8383interface ICoreWebView2Profile;
8484
85+ [uuid(C2669A3A-03A9-45E9-97EA-03CD55E5DC03), object, pointer_default(unique)]
86+ interface ICoreWebView2ControllerOptions : IUnknown {
87+ /// `ProfileName` property is to specify a profile name, which is only allowed to contain
88+ /// the following ASCII characters with the maximum length as 64 and will be treated in a
89+ /// case insensitive way.
90+ /// alphabet characters: a-z and A-Z
91+ /// digit characters: 0-9
92+ /// and '#', '@', '$', '(', ')', '+', '-', '_', '~', '.', ' ' (space).
93+ /// Note: the text must not end with a period '.' or ' ' (space). And, although upper case letters are
94+ /// allowed, they're treated just as lower case couterparts because the profile name will be mapped to
95+ /// the real profile directory path on disk and Windows file system handles path names in a case-insensitive way.
96+ [propget] HRESULT ProfileName([out, retval] LPWSTR* value);
97+ /// Sets the `ProfileName` property.
98+ [propput] HRESULT ProfileName([in] LPCWSTR value);
99+
100+ /// `InPrivateModeEnabled` property is to enable/disable InPrivate mode.
101+ [propget] HRESULT InPrivateModeEnabled([out, retval] BOOL* enabled);
102+ /// Sets the `InPrivateModeEnabled` property.
103+ [propput] HRESULT InPrivateModeEnabled([in] BOOL enabled);
104+ }
105+
85106[uuid(57FD205C-39D5-4BA1-8E7B-3E53C323EA87), object, pointer_default(unique)]
86107interface ICoreWebView2Environment5 : IUnknown
87108{
@@ -105,27 +126,6 @@ interface ICoreWebView2Environment5 : IUnknown
105126 [in] ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler* handler);
106127}
107128
108- [uuid(C2669A3A-03A9-45E9-97EA-03CD55E5DC03), object, pointer_default(unique)]
109- interface ICoreWebView2ControllerOptions : IUnknown {
110- /// `ProfileName` property is to specify a profile name, which is only allowed to contain
111- /// the following ASCII characters with the maximum length as 64 and will be treated in a
112- /// case insensitive way.
113- /// alphabet characters: a-z and A-Z
114- /// digit characters: 0-9
115- /// and '#', '@', '$', '(', ')', '+', '-', '_', '~', '.', ' ' (space).
116- /// Note: the text must not end with a period '.' or ' ' (space). And, although upper case letters are
117- /// allowed, they're treated just as lower case couterparts because the profile name will be mapped to
118- /// the real profile directory path on disk and Windows file system handles path names in a case-insensitive way.
119- [propget] HRESULT ProfileName([out, retval] LPWSTR* value);
120- /// Sets the `ProfileName` property.
121- [propput] HRESULT ProfileName([in] LPCWSTR value);
122-
123- /// `InPrivateModeEnabled` property is to enable/disable InPrivate mode.
124- [propget] HRESULT InPrivateModeEnabled([out, retval] BOOL* enabled);
125- /// Sets the `InPrivateModeEnabled` property.
126- [propput] HRESULT InPrivateModeEnabled([in] BOOL enabled);
127- }
128-
129129[uuid(6E5CE5F0-16E6-4A05-97D8-4E256B3EB609), object, pointer_default(unique)]
130130interface ICoreWebView2_7 : IUnknown {
131131 /// The associated `ICoreWebView2Profile` object.
@@ -147,6 +147,58 @@ interface ICoreWebView2Profile : IUnknown {
147147}
148148```
149149
150+ ## .NET and WinRT
151+
152+ ``` c#
153+ namespace Microsoft .Web .WebView2 .Core
154+ {
155+ runtimeclass CoreWebView2ControllerOptions;
156+ runtimeclass CoreWebView2Environment;
157+ runtimeclass CoreWebView2;
158+ runtimeclass CoreWebView2Profile;
159+
160+ runtimeclass CoreWebView2ControllerOptions
161+ {
162+ String ProfileName { get; set; };
163+
164+ Int32 InPrivateModeEnabled { get ; set ; };
165+ }
166+
167+ runtimeclass CoreWebView2Environment
168+ {
169+ // ...
170+
171+ CoreWebView2ControllerOptions CreateCoreWebView2ControllerOptions (
172+ String ProfileName , Int32 InPrivateModeEnabled );
173+
174+ Windows .Foundation .IAsyncOperation < CoreWebView2Controller >
175+ CreateCoreWebView2ControllerWithOptionsAsync (
176+ CoreWebView2ControllerWindowReference ParentWindow ,
177+ CoreWebView2ControllerOptions options );
178+
179+ Windows .Foundation .IAsyncOperation < CoreWebView2CompositionController >
180+ CreateCoreWebView2CompositionControllerWithOptionsAsync (
181+ CoreWebView2ControllerWindowReference ParentWindow ,
182+ CoreWebView2ControllerOptions options );
183+ }
184+
185+ runtimeclass CoreWebView2
186+ {
187+ // ...
188+ CoreWebView2Profile Profile { get ; };
189+ }
190+
191+ runtimeclass CoreWebView2Profile
192+ {
193+ String ProfileName { get ; };
194+
195+ Int32 InPrivateModeEnabled { get ; };
196+
197+ String ProfilePath { get ; };
198+ }
199+ }
200+ ```
201+
150202# Appendix
151203
152204Next we'll consolidate all profile-wide operations/settings into the interface
0 commit comments