OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/proxy/file_chooser_resource.h" | 5 #include "ppapi/proxy/file_chooser_resource.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string_split.h" | 8 #include "base/string_split.h" |
9 #include "ipc/ipc_message.h" | 9 #include "ipc/ipc_message.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 | 124 |
125 int32_t FileChooserResource::ShowInternal( | 125 int32_t FileChooserResource::ShowInternal( |
126 PP_Bool save_as, | 126 PP_Bool save_as, |
127 const PP_Var& suggested_file_name, | 127 const PP_Var& suggested_file_name, |
128 scoped_refptr<TrackedCallback> callback) { | 128 scoped_refptr<TrackedCallback> callback) { |
129 if (TrackedCallback::IsPending(callback_)) | 129 if (TrackedCallback::IsPending(callback_)) |
130 return PP_ERROR_INPROGRESS; | 130 return PP_ERROR_INPROGRESS; |
131 | 131 |
132 if (!sent_create_to_renderer()) | 132 if (!sent_create_to_renderer()) |
133 SendCreateToRenderer(PpapiHostMsg_FileChooser_Create()); | 133 SendCreate(RENDERER, PpapiHostMsg_FileChooser_Create()); |
134 | 134 |
135 callback_ = callback; | 135 callback_ = callback; |
136 StringVar* sugg_str = StringVar::FromPPVar(suggested_file_name); | 136 StringVar* sugg_str = StringVar::FromPPVar(suggested_file_name); |
137 | 137 |
138 PpapiHostMsg_FileChooser_Show msg( | 138 PpapiHostMsg_FileChooser_Show msg( |
139 PP_ToBool(save_as), | 139 PP_ToBool(save_as), |
140 mode_ == PP_FILECHOOSERMODE_OPENMULTIPLE, | 140 mode_ == PP_FILECHOOSERMODE_OPENMULTIPLE, |
141 sugg_str ? sugg_str->value() : std::string(), | 141 sugg_str ? sugg_str->value() : std::string(), |
142 accept_types_); | 142 accept_types_); |
143 CallRenderer<PpapiPluginMsg_FileChooser_ShowReply>(msg, | 143 Call<PpapiPluginMsg_FileChooser_ShowReply>(RENDERER, msg, |
144 base::Bind(&FileChooserResource::OnPluginMsgShowReply, this)); | 144 base::Bind(&FileChooserResource::OnPluginMsgShowReply, this)); |
145 return PP_OK_COMPLETIONPENDING; | 145 return PP_OK_COMPLETIONPENDING; |
146 } | 146 } |
147 | 147 |
148 } // namespace proxy | 148 } // namespace proxy |
149 } // namespace ppapi | 149 } // namespace ppapi |
OLD | NEW |