2017-01-11 00:00:30 +01:00
|
|
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
2012-10-16 21:28:07 +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.
|
|
|
|
//
|
2017-07-27 01:19:27 +02:00
|
|
|
// $hash=af23f12434672dcf50df95b4e0ec33b92d86943f$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2012-10-16 21:28:07 +02:00
|
|
|
|
2017-05-19 11:06:00 +02:00
|
|
|
#include "libcef_dll/ctocpp/dialog_handler_ctocpp.h"
|
2012-10-16 21:28:07 +02:00
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h"
|
|
|
|
#include "libcef_dll/transfer_util.h"
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
bool CefDialogHandlerCToCpp::OnFileDialog(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
FileDialogMode mode,
|
|
|
|
const CefString& title,
|
2015-01-20 19:24:54 +01:00
|
|
|
const CefString& default_file_path,
|
2017-05-17 11:29:28 +02:00
|
|
|
const std::vector<CefString>& accept_filters,
|
|
|
|
int selected_accept_filter,
|
2012-10-16 21:28:07 +02:00
|
|
|
CefRefPtr<CefFileDialogCallback> callback) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_dialog_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_file_dialog))
|
2012-10-16 21:28:07 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return false;
|
2015-01-20 19:24:54 +01:00
|
|
|
// Verify param: selected_accept_filter; type: simple_byval
|
|
|
|
DCHECK_GE(selected_accept_filter, 0);
|
|
|
|
if (selected_accept_filter < 0)
|
|
|
|
return false;
|
2012-10-16 21:28:07 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return false;
|
2015-01-20 19:24:54 +01:00
|
|
|
// Unverified params: title, default_file_path, accept_filters
|
2012-10-16 21:28:07 +02:00
|
|
|
|
2015-01-20 19:24:54 +01:00
|
|
|
// Translate param: accept_filters; type: string_vec_byref_const
|
|
|
|
cef_string_list_t accept_filtersList = cef_string_list_alloc();
|
|
|
|
DCHECK(accept_filtersList);
|
|
|
|
if (accept_filtersList)
|
|
|
|
transfer_string_list_contents(accept_filters, accept_filtersList);
|
2012-10-16 21:28:07 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
int _retval = _struct->on_file_dialog(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), mode, title.GetStruct(),
|
|
|
|
default_file_path.GetStruct(), accept_filtersList, selected_accept_filter,
|
2012-10-16 21:28:07 +02:00
|
|
|
CefFileDialogCallbackCppToC::Wrap(callback));
|
|
|
|
|
2015-01-20 19:24:54 +01:00
|
|
|
// Restore param:accept_filters; type: string_vec_byref_const
|
|
|
|
if (accept_filtersList)
|
|
|
|
cef_string_list_free(accept_filtersList);
|
2012-10-16 21:28:07 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-10-16 21:28:07 +02:00
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CefDialogHandlerCToCpp::CefDialogHandlerCToCpp() {}
|
2015-04-26 20:40:01 +02:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
cef_dialog_handler_t*
|
|
|
|
CefCToCppRefCounted<CefDialogHandlerCToCpp,
|
|
|
|
CefDialogHandler,
|
|
|
|
cef_dialog_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefDialogHandler* c) {
|
2015-04-26 20:40:01 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-09-01 13:24:30 +02:00
|
|
|
#if DCHECK_IS_ON()
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
base::AtomicRefCount CefCToCppRefCounted<CefDialogHandlerCToCpp,
|
|
|
|
CefDialogHandler,
|
2017-07-27 01:19:27 +02:00
|
|
|
cef_dialog_handler_t>::DebugObjCt
|
|
|
|
ATOMIC_DECLARATION;
|
2012-10-16 21:28:07 +02:00
|
|
|
#endif
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefDialogHandlerCToCpp,
|
|
|
|
CefDialogHandler,
|
|
|
|
cef_dialog_handler_t>::kWrapperType =
|
|
|
|
WT_DIALOG_HANDLER;
|