Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1719)

Unified Diff: ppapi/proxy/file_chooser_resource.cc

Issue 11022005: Converted PluginResource reply message handling to use base::Callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/file_chooser_resource.cc
diff --git a/ppapi/proxy/file_chooser_resource.cc b/ppapi/proxy/file_chooser_resource.cc
index 87d11285e1d1b1323370c53bf7ff14f34d849fdd..f41ade58b8a87d93c3bd2ccf74184a3e820eb694 100644
--- a/ppapi/proxy/file_chooser_resource.cc
+++ b/ppapi/proxy/file_chooser_resource.cc
@@ -4,6 +4,7 @@
#include "ppapi/proxy/file_chooser_resource.h"
+#include "base/bind.h"
#include "base/string_split.h"
#include "ipc/ipc_message.h"
#include "ppapi/c/pp_errors.h"
@@ -97,15 +98,6 @@ void FileChooserResource::PopulateAcceptTypes(
}
}
-void FileChooserResource::OnReplyReceived(
- const ResourceMessageReplyParams& params,
- const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(FileChooserResource, msg)
- PPAPI_DISPATCH_RESOURCE_REPLY(PpapiPluginMsg_FileChooser_ShowReply,
- OnPluginMsgShowReply)
- IPC_END_MESSAGE_MAP()
-}
-
void FileChooserResource::OnPluginMsgShowReply(
const ResourceMessageReplyParams& params,
const std::vector<PPB_FileRef_CreateInfo>& chosen_files) {
@@ -143,11 +135,13 @@ int32_t FileChooserResource::ShowInternal(
callback_ = callback;
StringVar* sugg_str = StringVar::FromPPVar(suggested_file_name);
- CallRenderer(PpapiHostMsg_FileChooser_Show(
- PP_ToBool(save_as),
- mode_ == PP_FILECHOOSERMODE_OPENMULTIPLE,
- sugg_str ? sugg_str->value() : std::string(),
- accept_types_));
+ PpapiHostMsg_FileChooser_Show msg(
+ PP_ToBool(save_as),
+ mode_ == PP_FILECHOOSERMODE_OPENMULTIPLE,
+ sugg_str ? sugg_str->value() : std::string(),
+ accept_types_);
+ CallRenderer<PpapiPluginMsg_FileChooser_ShowReply>(msg,
+ base::Bind(&FileChooserResource::OnPluginMsgShowReply, this));
return PP_OK_COMPLETIONPENDING;
}

Powered by Google App Engine
This is Rietveld 408576698