void WebBrowserHost::ClearCookies(const String& url, const String& cookieName)
{
    CefRefPtr<CefCookieManager> manager = CefCookieManager::GetGlobalManager(nullptr);

    if (!manager.get())
        return;

    CefString cefUrl;
    cefUrl.FromASCII(url.CString());

    CefString cefCookieName;
    cefCookieName.FromASCII(cookieName.CString());

    manager->DeleteCookies(cefUrl, cefCookieName, nullptr);

}
Exemple #2
0
//================================================================================
// Ejecuta JavaScript
//================================================================================
void CefBasePanel::ExecuteJavaScript( const char *script )
{
    if ( !GetClient() )
        return;

    CefString code;
    code.FromASCII( script );

    CefString file;
    GetClient()->GetBrowser()->GetMainFrame()->ExecuteJavaScript( code, file, 0 );
}
Exemple #3
0
//================================================================================
// Abre la dirección web
//================================================================================
void CefBasePanel::OpenURL( const char *address )
{
    if ( !GetClient() )
        return;

    CefString str;
    str.FromASCII( address );

    GetClient()->GetBrowser()->GetMainFrame()->LoadURL( str );
    ResizeView();

    DevMsg( "CefBasePanel::OpenURL: %s \n", address );
}
void SchemeExtender::GetResponseHeaders(CefRefPtr<CefResponse> response, int64& response_length, CefString& redirectUrl)
{
	if (!m_pSchemeExtender)
		return;

	// nat: moved this stanza from ProcessRequest() when redirectUrl param
	// moved from base-class ProcessRequest() method to GetResponseHeaders()
	// method
	if (m_redirect)
	{
		const char *szRUrl = m_pSchemeExtender->getRedirectUrl();

		if (szRUrl)
			redirectUrl.FromASCII(szRUrl);
	}
	// end migrated code

	response_length = m_pSchemeExtender->getResponseSize();
	const char* mime = m_pSchemeExtender->getResponseMimeType();

	if (mime)
		response->SetMimeType(mime);
}