summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_file_chooser_proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/proxy/ppb_file_chooser_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_file_chooser_proxy.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/ppapi/proxy/ppb_file_chooser_proxy.cc b/ppapi/proxy/ppb_file_chooser_proxy.cc
index d8ea705..cda175f 100644
--- a/ppapi/proxy/ppb_file_chooser_proxy.cc
+++ b/ppapi/proxy/ppb_file_chooser_proxy.cc
@@ -194,11 +194,13 @@ void PPB_FileChooser_Proxy::OnMsgCreate(PP_Instance instance,
}
void PPB_FileChooser_Proxy::OnMsgShow(const HostResource& chooser) {
- EnterHostFromHostResourceForceCallback<PPB_FileChooser_API> enter(
- chooser, callback_factory_, &PPB_FileChooser_Proxy::OnShowCallback,
- chooser);
- if (enter.succeeded())
- enter.SetResult(enter.object()->Show(enter.callback()));
+ CompletionCallback callback = callback_factory_.NewOptionalCallback(
+ &PPB_FileChooser_Proxy::OnShowCallback, chooser);
+
+ int32_t result = ppb_file_chooser_target()->Show(
+ chooser.host_resource(), callback.pp_completion_callback());
+ if (result != PP_OK_COMPLETIONPENDING)
+ callback.Run(result);
}
void PPB_FileChooser_Proxy::OnMsgChooseComplete(