mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefURLRequestClient::GetAuthCredentials callback (issue #975).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1416 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef_request_handler.h"
|
||||
#include "include/capi/cef_request_handler_capi.h"
|
||||
#include "include/cef_auth_callback.h"
|
||||
#include "include/capi/cef_auth_callback_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
|
@@ -10,6 +10,7 @@
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/auth_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/urlrequest_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h"
|
||||
|
||||
@@ -94,6 +95,41 @@ void CefURLRequestClientCToCpp::OnDownloadData(CefRefPtr<CefURLRequest> request,
|
||||
data_length);
|
||||
}
|
||||
|
||||
bool CefURLRequestClientCToCpp::GetAuthCredentials(bool isProxy,
|
||||
const CefString& host, int port, const CefString& realm,
|
||||
const CefString& scheme, CefRefPtr<CefAuthCallback> callback) {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_auth_credentials))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: host; type: string_byref_const
|
||||
DCHECK(!host.empty());
|
||||
if (host.empty())
|
||||
return false;
|
||||
// Verify param: scheme; type: string_byref_const
|
||||
DCHECK(!scheme.empty());
|
||||
if (scheme.empty())
|
||||
return false;
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback.get());
|
||||
if (!callback.get())
|
||||
return false;
|
||||
// Unverified params: realm
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->get_auth_credentials(struct_,
|
||||
isProxy,
|
||||
host.GetStruct(),
|
||||
port,
|
||||
realm.GetStruct(),
|
||||
scheme.GetStruct(),
|
||||
CefAuthCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefURLRequestClientCToCpp, CefURLRequestClient,
|
||||
|
@@ -41,6 +41,9 @@ class CefURLRequestClientCToCpp
|
||||
uint64 current, uint64 total) OVERRIDE;
|
||||
virtual void OnDownloadData(CefRefPtr<CefURLRequest> request,
|
||||
const void* data, size_t data_length) OVERRIDE;
|
||||
virtual bool GetAuthCredentials(bool isProxy, const CefString& host, int port,
|
||||
const CefString& realm, const CefString& scheme,
|
||||
CefRefPtr<CefAuthCallback> callback) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
|
Reference in New Issue
Block a user