This source file includes following definitions.
- Create
- IsFileChooser
- Show_0_5
- GetNextChosenFile
- Show
- GetPPB_FileChooser_Dev_0_5_Thunk
- GetPPB_FileChooser_Dev_0_6_Thunk
#include "ppapi/c/dev/ppb_file_chooser_dev.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
#include "ppapi/thunk/ppb_file_chooser_api.h"
namespace ppapi {
namespace thunk {
namespace {
PP_Resource Create(PP_Instance instance,
PP_FileChooserMode_Dev mode,
struct PP_Var accept_types) {
VLOG(4) << "PPB_FileChooser_Dev::Create()";
EnterResourceCreation enter(instance);
if (enter.failed())
return 0;
return enter.functions()->CreateFileChooser(instance, mode, accept_types);
}
PP_Bool IsFileChooser(PP_Resource resource) {
VLOG(4) << "PPB_FileChooser_Dev::IsFileChooser()";
EnterResource<PPB_FileChooser_API> enter(resource, false);
return PP_FromBool(enter.succeeded());
}
int32_t Show_0_5(PP_Resource chooser, struct PP_CompletionCallback callback) {
VLOG(4) << "PPB_FileChooser_Dev::Show()";
EnterResource<PPB_FileChooser_API> enter(chooser, callback, true);
if (enter.failed())
return enter.retval();
return enter.SetResult(enter.object()->Show0_5(enter.callback()));
}
PP_Resource GetNextChosenFile(PP_Resource chooser) {
VLOG(4) << "PPB_FileChooser_Dev::GetNextChosenFile()";
EnterResource<PPB_FileChooser_API> enter(chooser, true);
if (enter.failed())
return 0;
return enter.object()->GetNextChosenFile();
}
int32_t Show(PP_Resource chooser,
struct PP_ArrayOutput output,
struct PP_CompletionCallback callback) {
VLOG(4) << "PPB_FileChooser_Dev::Show()";
EnterResource<PPB_FileChooser_API> enter(chooser, callback, true);
if (enter.failed())
return enter.retval();
return enter.SetResult(enter.object()->Show(output, enter.callback()));
}
const PPB_FileChooser_Dev_0_5 g_ppb_filechooser_dev_thunk_0_5 = {
&Create,
&IsFileChooser,
&Show_0_5,
&GetNextChosenFile
};
const PPB_FileChooser_Dev_0_6 g_ppb_filechooser_dev_thunk_0_6 = {
&Create,
&IsFileChooser,
&Show
};
}
PPAPI_THUNK_EXPORT const PPB_FileChooser_Dev_0_5*
GetPPB_FileChooser_Dev_0_5_Thunk() {
return &g_ppb_filechooser_dev_thunk_0_5;
}
PPAPI_THUNK_EXPORT const PPB_FileChooser_Dev_0_6*
GetPPB_FileChooser_Dev_0_6_Thunk() {
return &g_ppb_filechooser_dev_thunk_0_6;
}
}
}