@@ -10,9 +10,9 @@ as well as be notified when the favicon changes.
1010# Examples
1111## Win32 C++ Registering a listener for favicon changes
1212``` cpp
13- CHECK_FAILURE (m_webViewStaging4 ->add_FaviconChanged(
14- Callback<ICoreWebView2StagingFaviconChangedEventHandler >(
15- [ this] (ICoreWebView2Staging4 * sender, IUnknown* args) -> HRESULT {
13+ CHECK_FAILURE (m_webView ->add_FaviconChanged(
14+ Callback<ICoreWebView2FaviconChangedEventHandler >(
15+ [ this] (ICoreWebView2 * sender, IUnknown* args) -> HRESULT {
1616
1717 wil::unique_cotaskmem_string url;
1818 CHECK_FAILURE(sender->get_FaviconUri(&url));
@@ -22,7 +22,7 @@ as well as be notified when the favicon changes.
2222 COREWEBVIEW2_FAVICON_IMAGE_FORMAT_PNG,
2323 pStream,
2424 Callback<
25- ICoreWebView2StagingGetFaviconCompletedHandler >(
25+ ICoreWebView2GetFaviconCompletedHandler >(
2626 [&pStream, this](HRESULT code) -> HRESULT {
2727 Gdiplus::Bitmap* pBitmap = new Gdiplus::Bitmap(pStream);
2828 HICON icon;
@@ -111,12 +111,24 @@ typedef enum COREWEBVIEW2_FAVICON_IMAGE_FORMAT {
111111
112112## .Net/ WinRT
113113``` c#
114- [ interface_name ( " Microsoft.Web.WebView2.Core.ICoreWebView2 " )]
114+ namespace Microsoft .Web .WebView2 .Core
115115{
116- String FaviconUri { get ; };
116+ enum CoreWebView2FaviconImageFormat
117+ {
118+ Png = 0 ,
119+ Jpeg = 1 ,
120+ };
117121
118- event Windows .Foundation .TypedEventHandler < CoreWebView2 , Object > FaviconChanged ;
122+ runtimeclass CoreWebView2
123+ {
124+ [interface_name (" Microsoft.Web.WebView2.Core.ICoreWebView2_10" )]
125+ {
126+ String FaviconUri { get; };
119127
120- Windows .Foundation .IAsyncAction GetFaviconAsync (CoreWebView2FaviconImageFormat format , Windows .Storage .Streams .IRandomAccessStream imageStream );
128+ event Windows .Foundation .TypedEventHandler < CoreWebView2 , Object > FaviconChanged ;
129+
130+ Windows .Foundation .IAsyncAction GetFaviconAsync (CoreWebView2FaviconImageFormat format , Windows .Storage .Streams .IRandomAccessStream imageStream );
131+ }
132+ }
121133}
122134```
0 commit comments