mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
Merge pull request #1011 from amaitland/enhancement/favicon
Add OnFaviconURLChange
This commit is contained in:
@@ -154,6 +154,16 @@ namespace CefSharp
|
||||
}
|
||||
}
|
||||
|
||||
void ClientAdapter::OnFaviconURLChange(CefRefPtr<CefBrowser> browser, const std::vector<CefString>& iconUrls)
|
||||
{
|
||||
auto handler = _browserControl->RequestHandler;
|
||||
|
||||
if(handler != nullptr)
|
||||
{
|
||||
handler->OnFaviconUrlChange(_browserControl, StringUtils::ToClr(iconUrls));
|
||||
}
|
||||
}
|
||||
|
||||
bool ClientAdapter::OnTooltip(CefRefPtr<CefBrowser> browser, CefString& text)
|
||||
{
|
||||
String^ tooltip = StringUtils::ToClr(text);
|
||||
|
||||
@@ -107,6 +107,7 @@ namespace CefSharp
|
||||
virtual DECL void OnLoadingStateChange(CefRefPtr<CefBrowser> browser, bool isLoading, bool canGoBack, bool canGoForward) OVERRIDE;
|
||||
virtual DECL void OnAddressChange(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& url) OVERRIDE;
|
||||
virtual DECL void OnTitleChange(CefRefPtr<CefBrowser> browser, const CefString& title) OVERRIDE;
|
||||
virtual DECL void OnFaviconURLChange(CefRefPtr<CefBrowser> browser, const std::vector<CefString>& iconUrls) OVERRIDE;
|
||||
virtual DECL bool OnTooltip(CefRefPtr<CefBrowser> browser, CefString& text) OVERRIDE;
|
||||
virtual DECL bool OnConsoleMessage(CefRefPtr<CefBrowser> browser, const CefString& message, const CefString& source, int line) OVERRIDE;
|
||||
virtual DECL void OnStatusMessage(CefRefPtr<CefBrowser> browser, const CefString& message) OVERRIDE;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CefSharp.Example
|
||||
{
|
||||
@@ -71,5 +72,10 @@ namespace CefSharp.Example
|
||||
{
|
||||
return url.StartsWith("mailto");
|
||||
}
|
||||
|
||||
public void OnFaviconUrlChange(IWebBrowser browser, IList<string> urls)
|
||||
{
|
||||
var url = urls[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
@@ -108,5 +109,12 @@ namespace CefSharp
|
||||
/// <param name="url">the request url</param>
|
||||
/// <returns>return to true to attempt execution via the registered OS protocol handler, if any. Otherwise return false.</returns>
|
||||
bool OnProtocolExecution(IWebBrowser browser, string url);
|
||||
|
||||
/// <summary>
|
||||
/// Called when the page icon changes.
|
||||
/// </summary>
|
||||
/// <param name="browser">the browser object</param>
|
||||
/// <param name="urls">list of urls where the favicons can be downloaded</param>
|
||||
void OnFaviconUrlChange(IWebBrowser browser, IList<string> urls);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user