Merge pull request #1011 from amaitland/enhancement/favicon

Add OnFaviconURLChange
This commit is contained in:
Alex Maitland
2015-05-07 15:22:40 +10:00
4 changed files with 25 additions and 0 deletions
+10
View File
@@ -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);
+1
View File
@@ -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;
+6
View File
@@ -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];
}
}
}
+8
View File
@@ -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);
}
}