mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Add a new CefApp interface that provides global handlers and gets passed to CefInitialize() (issue #399).
- Add a new CefProxyHandler interface to allow applications to resolve proxy information (issue #389). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@394 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -1069,6 +1069,25 @@ enum cef_dom_node_type_t
|
||||
DOM_NODE_TYPE_XPATH_NAMESPACE,
|
||||
};
|
||||
|
||||
///
|
||||
// Proxy types.
|
||||
///
|
||||
enum cef_proxy_type_t
|
||||
{
|
||||
PROXY_TYPE_DIRECT = 0,
|
||||
PROXY_TYPE_NAMED,
|
||||
PROXY_TYPE_PAC_STRING,
|
||||
};
|
||||
|
||||
///
|
||||
// Proxy information.
|
||||
///
|
||||
typedef struct _cef_proxy_info_t
|
||||
{
|
||||
enum cef_proxy_type_t proxyType;
|
||||
cef_string_t proxyList;
|
||||
} cef_proxy_info_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -527,4 +527,69 @@ struct CefCookieTraits {
|
||||
///
|
||||
typedef CefStructBase<CefCookieTraits> CefCookie;
|
||||
|
||||
|
||||
struct CefProxyInfoTraits {
|
||||
typedef cef_proxy_info_t struct_type;
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s)
|
||||
{
|
||||
cef_string_clear(&s->proxyList);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target, bool copy)
|
||||
{
|
||||
target->proxyType = src->proxyType;
|
||||
cef_string_set(src->proxyList.str, src->proxyList.length,
|
||||
&target->proxyList, copy);
|
||||
}
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing the results of proxy resolution.
|
||||
///
|
||||
class CefProxyInfo : public CefStructBase<CefProxyInfoTraits>
|
||||
{
|
||||
public:
|
||||
///
|
||||
// Use a direction connection instead of a proxy.
|
||||
///
|
||||
void UseDirect()
|
||||
{
|
||||
proxyType = PROXY_TYPE_DIRECT;
|
||||
}
|
||||
|
||||
///
|
||||
// Use one or more named proxy servers specified in WinHTTP format. Each proxy
|
||||
// server is of the form:
|
||||
//
|
||||
// [<scheme>"://"]<server>[":"<port>]
|
||||
//
|
||||
// Multiple values may be separated by semicolons or whitespace. For example,
|
||||
// "foo1:80;foo2:80".
|
||||
///
|
||||
void UseNamedProxy(const CefString& proxy_uri_list)
|
||||
{
|
||||
proxyType = PROXY_TYPE_NAMED;
|
||||
(CefString(&proxyList)) = proxy_uri_list;
|
||||
}
|
||||
|
||||
///
|
||||
// Use one or more named proxy servers specified in PAC script format. For
|
||||
// example, "PROXY foobar:99; SOCKS fml:2; DIRECT".
|
||||
///
|
||||
void UsePacString(const CefString& pac_string)
|
||||
{
|
||||
proxyType = PROXY_TYPE_PAC_STRING;
|
||||
(CefString(&proxyList)) = pac_string;
|
||||
}
|
||||
|
||||
bool IsDirect() const { return proxyType == PROXY_TYPE_DIRECT; }
|
||||
bool IsNamedProxy() const { return proxyType == PROXY_TYPE_NAMED; }
|
||||
bool IsPacString() const { return proxyType == PROXY_TYPE_PAC_STRING; }
|
||||
|
||||
CefString ProxyList() const { return CefString(&proxyList); }
|
||||
};
|
||||
|
||||
#endif // _CEF_TYPES_WRAPPERS_H
|
||||
|
Reference in New Issue
Block a user