Skip to content

Commit 5f39822

Browse files
Update names of an event and a property
1 parent daf99fd commit 5f39822

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

specs/FileTypePolicy.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ We'd appreciate your feedback.
1313

1414
# Description
1515

16-
We proposed the `CoreWebView2.FileTypePolicyChecking` event. You can register
17-
this event to get the file path, file extension and URI information,
16+
We proposed the `CoreWebView2.SaveFileSecurityCheckStarting` event. You can register
17+
this event to get the file path, file extension and URI source information,
1818
when end users try to save a file from your App. Then you can apply your own
1919
rules to allow save the file with, or without a default warning dialog;
2020
to cancel the saving; and even to create your own UI to manage runtime
@@ -30,12 +30,12 @@ bool ScenarioFileTypePolicyStaging::AddCustomFileTypePolicies()
3030
{
3131
if (!m_webView2Staging25)
3232
return false;
33-
// Register a handler for the `FileTypePolicyChecking` event.
34-
m_webView2Staging25->add_FileTypePolicyChecking(
35-
Callback<ICoreWebView2StagingFileTypePolicyCheckingEventHandler>(
33+
// Register a handler for the `SaveFileSecurityCheckStarting` event.
34+
m_webView2Staging25->add_SaveFileSecurityCheckStarting(
35+
Callback<ICoreWebView2StagingSaveFileSecurityCheckStartingEventHandler>(
3636
[this](
3737
ICoreWebView2* sender,
38-
ICoreWebView2StagingFileTypePolicyCheckingEventArgs* args) -> HRESULT
38+
ICoreWebView2StagingSaveFileSecurityCheckStartingEventArgs* args) -> HRESULT
3939
{
4040
// Get the file extension for file to be saved.
4141
// And create your own rules of file type policy.
@@ -59,7 +59,7 @@ bool ScenarioFileTypePolicyStaging::AddCustomFileTypePolicies()
5959
return S_OK;
6060
})
6161
.Get(),
62-
&m_fileTypePolicyCheckingToken);
62+
&m_saveFileSecurityCheckStartingToken);
6363
return true;
6464
}
6565
```
@@ -71,8 +71,8 @@ The sample code will register the event with custom rules.
7171
```c#
7272
void AddCustomFileTypePoliciesExecuted(object target, ExecutedRoutedEventArgs e)
7373
{
74-
// Register a handler for the `FileTypePolicyChecking` event.
75-
webView.CoreWebView2.FileTypePolicyChecking += (sender, args) =>
74+
// Register a handler for the `SaveFileSecurityCheckStarting` event.
75+
webView.CoreWebView2.SaveFileSecurityCheckStarting += (sender, args) =>
7676
{
7777
// Get the file extension for file to be saved.
7878
// And create your own rules of file type policy.
@@ -99,15 +99,15 @@ void AddCustomFileTypePoliciesExecuted(object target, ExecutedRoutedEventArgs e)
9999
## Win32 C++
100100
```c++
101101
interface ICoreWebView2 : IUnknown {
102-
/// Adds an event handler for the `FileTypePolicyChecking` event.
102+
/// Adds an event handler for the `SaveFileSecurityCheckStarting` event.
103103
/// If the default save file picker is used to save a file, for
104104
/// example, client using the File System API `showSaveFilePicker`;
105105
/// this event will be raised during system FileTypePolicy
106106
/// checking the dangerous file extension list.
107107
///
108108
/// Developers can specify their own decision on if allow this file
109109
/// type extension to be saved, or downloaded. Here are two properties
110-
/// in `ICoreWebView2FileTypePolicyCheckingEventArgs` to manage the
110+
/// in `ICoreWebView2SaveFileSecurityCheckStartingEventArgs` to manage the
111111
/// decision, `Cancel` and `SuppressDefaultPolicy`.
112112
/// Table of Properties' value and result:
113113
///
@@ -122,18 +122,18 @@ interface ICoreWebView2 : IUnknown {
122122
/// | ------ | ------ | ---------------------
123123
/// | True | Any | Skip the default policy check and the possible
124124
/// | | | security warning. Abort save or download.
125-
HRESULT add_FileTypePolicyChecking(
126-
[in] ICoreWebView2StagingFileTypePolicyCheckingEventHandler* eventHandler,
125+
HRESULT add_SaveFileSecurityCheckStarting(
126+
[in] ICoreWebView2StagingSaveFileSecurityCheckStartingEventHandler* eventHandler,
127127
[out] EventRegistrationToken* token);
128128

129-
/// Removes an event handler previously added with `add_FileTypePolicyChecking`.
130-
HRESULT remove_FileTypePolicyChecking(
129+
/// Removes an event handler previously added with `add_SaveFileSecurityCheckStarting`.
130+
HRESULT remove_SaveFileSecurityCheckStarting(
131131
[in] EventRegistrationToken token);
132132
}
133133

134134

135-
/// The event args for `FileTypePolicyChecking` event.
136-
interface ICoreWebView2StagingFileTypePolicyCheckingEventArgs : IUnknown {
135+
/// The event args for `SaveFileSecurityCheckStarting` event.
136+
interface ICoreWebView2StagingSaveFileSecurityCheckStartingEventArgs : IUnknown {
137137
/// Gets the `Cancel` property.
138138
[propget] HRESULT Cancel([out, retval] BOOL* value);
139139

@@ -169,10 +169,10 @@ interface ICoreWebView2StagingFileTypePolicyCheckingEventArgs : IUnknown {
169169
[propput] HRESULT SuppressDefaultPolicy([in] BOOL value);
170170

171171
/// The URI source of this file save operation.
172-
[propget] HRESULT Uri([out, retval] LPWSTR* value);
172+
[propget] HRESULT SourceUri([out, retval] LPWSTR* value);
173173

174174
/// Returns an `ICoreWebView2Deferral` object. Use this operation to complete
175-
/// the FileTypePolicyCheckingEvent.
175+
/// the SaveFileSecurityCheckStartingEvent.
176176
///
177177
/// The default policy checking and any default UI will be blocked temporarily,
178178
/// saving file to local won't start, until the deferral is completed.
@@ -181,12 +181,12 @@ interface ICoreWebView2StagingFileTypePolicyCheckingEventArgs : IUnknown {
181181
);
182182
}
183183

184-
/// Receives `FileTypePolicyChecking` events.
185-
interface ICoreWebView2StagingFileTypePolicyCheckingEventHandler : IUnknown {
184+
/// Receives `SaveFileSecurityCheckStarting` events.
185+
interface ICoreWebView2StagingSaveFileSecurityCheckStartingEventHandler : IUnknown {
186186
/// Provides the event args for the corresponding event.
187187
HRESULT Invoke(
188188
[in] ICoreWebView2* sender,
189-
[in] ICoreWebView2StagingFileTypePolicyCheckingEventArgs* args);
189+
[in] ICoreWebView2StagingSaveFileSecurityCheckStartingEventArgs* args);
190190
}
191191
```
192192

@@ -195,16 +195,16 @@ interface ICoreWebView2StagingFileTypePolicyCheckingEventHandler : IUnknown {
195195
namespace Microsoft.Web.WebView2.Core
196196
{
197197

198-
runtimeclass CoreWebView2FileTypePolicyCheckingEventArgs;
198+
runtimeclass CoreWebView2SaveFileSecurityCheckStartingEventArgs;
199199
runtimeclass CoreWebView2;
200200

201-
runtimeclass CoreWebView2FileTypePolicyCheckingEventArgs
201+
runtimeclass CoreWebView2SaveFileSecurityCheckStartingEventArgs
202202
{
203203
Boolean Cancel { get; set; };
204204
String FileExtension { get; };
205205
String FilePath { get; };
206206
Boolean SuppressDefaultPolicy { get; set; };
207-
String Uri { get; };
207+
String SourceUri { get; };
208208
Windows.Foundation.Deferral GetDeferral();
209209
};
210210

@@ -215,7 +215,7 @@ namespace Microsoft.Web.WebView2.Core
215215
[interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2_25")]
216216
{
217217
event Windows.Foundation.TypedEventHandler
218-
<CoreWebView2, CoreWebView2FileTypePolicyCheckingEventArgs> FileTypePolicyChecking;
218+
<CoreWebView2, CoreWebView2SaveFileSecurityCheckStartingEventArgs> SaveFileSecurityCheckStarting;
219219
}
220220
};
221221
}

0 commit comments

Comments
 (0)