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

Side by Side Diff: ppapi/proxy/file_chooser_resource.cc

Issue 11106019: PluginResource: Avoid having two sets of similar methods for talking with browser and renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/proxy/flash_device_id_resource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | ppapi/proxy/flash_device_id_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698