@@ -3,28 +3,67 @@ The WebView2 team has been asked to provide an API to expose the Browser Task
33Manager. At the current time, it is expected that the user will close the Task
44Manager manually, so we do not need to provide an API to close it.
55
6+ In this document we describe the updated API. We'd appreciate your feedback.
7+
68# Description
7- TBD
9+ We propose extending ` CoreWebView2 ` to provide a ` ShowTaskManager ` method.
10+ This method will open a new window containing the task manager. If the task
11+ manager is already opened, this method will do nothing.
812
913# Examples
10- ## C++: TBD
14+ ## C++: Show Task Manager
1115
1216``` cpp
13- TBD
17+ wil::com_ptr<ICoreWebView2_5> m_webview;
18+
19+ // This method could be called from a menu, such as
20+ // [Script -> Show Task Manager].
21+ void ScriptComponent::ShowTaskManager ()
22+ {
23+ CHECK_FAILURE (m_webview->ShowTaskManager())
24+ }
25+
26+
1427```
1528
16- ## C#: TBD
29+ ## C#: Show Task Manager
1730``` c#
18- TBD
31+ private WebView2 m_webview ;
32+
33+ // This method could be called from a menu, such as
34+ // [Script -> Show Task Manager].
35+ void ShowTaskManager ()
36+ {
37+ m_webview .CoreWebView2 .ShowTaskManager ();
38+ }
1939```
2040
2141# API Details
2242## C++
2343```
24- TBD
44+ /// This is a continuation of the `ICoreWebView2_4` interface
45+ [uuid(20d02d59-6df2-42dc-bd06-f98a694b1302), object, pointer_default(unique)]
46+ interface ICoreWebView2_5 : ICoreWebView2_4 {
47+ /// Shows the Browser Task Manager view as a new window. Does nothing
48+ /// if run when the Browser Task Manager is already open.
49+ HRESULT ShowTaskManager();
50+ }
2551```
2652
2753## C#
2854``` c#
29- TBD
55+ namespace Microsoft .Web .WebView2 .Core
56+ {
57+ runtimeclass CoreWebView2
58+ {
59+ // There are many methods and properties of ICoreWebView2_* which I am
60+ // not including here for simplicity.
61+
62+ [interface_name (" Microsoft.Web.WebView2.Core.ICoreWebView2_5" )]
63+ {
64+ // ICoreWebView2_5 members
65+ void ShowTaskManager();
66+ }
67+ }
68+ }
3069```
0 commit comments