2016-01-08 20:00:27 +01:00
|
|
|
// Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
2014-02-05 21:35:45 +01:00
|
|
|
#include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
|
2015-03-02 21:25:14 +01:00
|
|
|
#include "libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/set_cookie_callback_cpptoc.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
|
2012-04-04 00:14:28 +02:00
|
|
|
#include "libcef_dll/transfer_util.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
// STATIC METHODS - Body may be edited by hand.
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
CefRefPtr<CefCookieManager> CefCookieManager::GetGlobalManager(
|
|
|
|
CefRefPtr<CefCompletionCallback> callback) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: callback
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Execute
|
2015-03-02 21:25:14 +01:00
|
|
|
cef_cookie_manager_t* _retval = cef_cookie_manager_get_global_manager(
|
|
|
|
CefCompletionCallbackCppToC::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefCookieManagerCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefCookieManager> CefCookieManager::CreateManager(
|
2015-03-02 21:25:14 +01:00
|
|
|
const CefString& path, bool persist_session_cookies,
|
|
|
|
CefRefPtr<CefCompletionCallback> callback) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: path, callback
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_cookie_manager_t* _retval = cef_cookie_manager_create_manager(
|
2013-02-13 20:53:41 +01:00
|
|
|
path.GetStruct(),
|
2015-03-02 21:25:14 +01:00
|
|
|
persist_session_cookies,
|
|
|
|
CefCompletionCallbackCppToC::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefCookieManagerCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2012-04-04 00:14:28 +02:00
|
|
|
void CefCookieManagerCToCpp::SetSupportedSchemes(
|
2015-03-02 21:25:14 +01:00
|
|
|
const std::vector<CefString>& schemes,
|
|
|
|
CefRefPtr<CefCompletionCallback> callback) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_cookie_manager_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, set_supported_schemes))
|
2012-04-04 00:14:28 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: callback
|
|
|
|
|
2012-04-04 00:14:28 +02:00
|
|
|
// Translate param: schemes; type: string_vec_byref_const
|
|
|
|
cef_string_list_t schemesList = cef_string_list_alloc();
|
|
|
|
DCHECK(schemesList);
|
|
|
|
if (schemesList)
|
|
|
|
transfer_string_list_contents(schemes, schemesList);
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
_struct->set_supported_schemes(_struct,
|
2015-03-02 21:25:14 +01:00
|
|
|
schemesList,
|
|
|
|
CefCompletionCallbackCppToC::Wrap(callback));
|
2012-04-04 00:14:28 +02:00
|
|
|
|
|
|
|
// Restore param:schemes; type: string_vec_byref_const
|
|
|
|
if (schemesList)
|
|
|
|
cef_string_list_free(schemesList);
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
bool CefCookieManagerCToCpp::VisitAllCookies(
|
|
|
|
CefRefPtr<CefCookieVisitor> visitor) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_cookie_manager_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, visit_all_cookies))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: visitor; type: refptr_diff
|
|
|
|
DCHECK(visitor.get());
|
|
|
|
if (!visitor.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->visit_all_cookies(_struct,
|
2012-04-03 03:34:16 +02:00
|
|
|
CefCookieVisitorCppToC::Wrap(visitor));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefCookieManagerCToCpp::VisitUrlCookies(const CefString& url,
|
|
|
|
bool includeHttpOnly, CefRefPtr<CefCookieVisitor> visitor) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_cookie_manager_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, visit_url_cookies))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: url; type: string_byref_const
|
|
|
|
DCHECK(!url.empty());
|
|
|
|
if (url.empty())
|
|
|
|
return false;
|
|
|
|
// Verify param: visitor; type: refptr_diff
|
|
|
|
DCHECK(visitor.get());
|
|
|
|
if (!visitor.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->visit_url_cookies(_struct,
|
2012-04-03 03:34:16 +02:00
|
|
|
url.GetStruct(),
|
|
|
|
includeHttpOnly,
|
|
|
|
CefCookieVisitorCppToC::Wrap(visitor));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefCookieManagerCToCpp::SetCookie(const CefString& url,
|
2015-03-02 21:25:14 +01:00
|
|
|
const CefCookie& cookie, CefRefPtr<CefSetCookieCallback> callback) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_cookie_manager_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, set_cookie))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: url; type: string_byref_const
|
|
|
|
DCHECK(!url.empty());
|
|
|
|
if (url.empty())
|
|
|
|
return false;
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: callback
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->set_cookie(_struct,
|
2012-04-03 03:34:16 +02:00
|
|
|
url.GetStruct(),
|
2015-03-02 21:25:14 +01:00
|
|
|
&cookie,
|
|
|
|
CefSetCookieCallbackCppToC::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefCookieManagerCToCpp::DeleteCookies(const CefString& url,
|
2015-03-02 21:25:14 +01:00
|
|
|
const CefString& cookie_name,
|
|
|
|
CefRefPtr<CefDeleteCookiesCallback> callback) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_cookie_manager_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, delete_cookies))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: url, cookie_name, callback
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->delete_cookies(_struct,
|
2012-04-03 03:34:16 +02:00
|
|
|
url.GetStruct(),
|
2015-03-02 21:25:14 +01:00
|
|
|
cookie_name.GetStruct(),
|
|
|
|
CefDeleteCookiesCallbackCppToC::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
2013-02-13 20:53:41 +01:00
|
|
|
bool CefCookieManagerCToCpp::SetStoragePath(const CefString& path,
|
2015-03-02 21:25:14 +01:00
|
|
|
bool persist_session_cookies, CefRefPtr<CefCompletionCallback> callback) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_cookie_manager_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, set_storage_path))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: path, callback
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->set_storage_path(_struct,
|
2013-02-13 20:53:41 +01:00
|
|
|
path.GetStruct(),
|
2015-03-02 21:25:14 +01:00
|
|
|
persist_session_cookies,
|
|
|
|
CefCompletionCallbackCppToC::Wrap(callback));
|
2013-02-13 20:53:41 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefCookieManagerCToCpp::FlushStore(
|
2014-02-05 21:35:45 +01:00
|
|
|
CefRefPtr<CefCompletionCallback> callback) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_cookie_manager_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, flush_store))
|
2013-02-13 20:53:41 +01:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: callback
|
2013-02-13 20:53:41 +01:00
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->flush_store(_struct,
|
2014-02-05 21:35:45 +01:00
|
|
|
CefCompletionCallbackCppToC::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefCookieManagerCToCpp::CefCookieManagerCToCpp() {
|
|
|
|
}
|
|
|
|
|
|
|
|
template<> cef_cookie_manager_t* CefCToCpp<CefCookieManagerCToCpp,
|
|
|
|
CefCookieManager, cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefCookieManager* c) {
|
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
#ifndef NDEBUG
|
2014-07-15 00:18:51 +02:00
|
|
|
template<> base::AtomicRefCount CefCToCpp<CefCookieManagerCToCpp,
|
|
|
|
CefCookieManager, cef_cookie_manager_t>::DebugObjCt = 0;
|
2012-04-03 03:34:16 +02:00
|
|
|
#endif
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
template<> CefWrapperType CefCToCpp<CefCookieManagerCToCpp, CefCookieManager,
|
|
|
|
cef_cookie_manager_t>::kWrapperType = WT_COOKIE_MANAGER;
|