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

Side by Side Diff: content/renderer/pepper/pepper_file_chooser_host.cc

Issue 1410423003: [SafeBrowsing] Conditionalize unverified download blocking on whitelist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@flash-download-block
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « content/public/common/file_chooser_params.h ('k') | content/renderer/render_view_impl.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 "content/renderer/pepper/pepper_file_chooser_host.h" 5 #include "content/renderer/pepper/pepper_file_chooser_host.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/renderer/renderer_ppapi_host.h" 9 #include "content/public/renderer/renderer_ppapi_host.h"
10 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" 10 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 params.multiSelect = open_multiple; 142 params.multiSelect = open_multiple;
143 } 143 }
144 std::vector<blink::WebString> mime_types(accept_mime_types.size()); 144 std::vector<blink::WebString> mime_types(accept_mime_types.size());
145 for (size_t i = 0; i < accept_mime_types.size(); i++) { 145 for (size_t i = 0; i < accept_mime_types.size(); i++) {
146 mime_types[i] = blink::WebString::fromUTF8(accept_mime_types[i].data(), 146 mime_types[i] = blink::WebString::fromUTF8(accept_mime_types[i].data(),
147 accept_mime_types[i].size()); 147 accept_mime_types[i].size());
148 } 148 }
149 params.acceptTypes = mime_types; 149 params.acceptTypes = mime_types;
150 params.directory = false; 150 params.directory = false;
151 params.needLocalPath = true; 151 params.needLocalPath = true;
152 params.requestor = renderer_ppapi_host_->GetDocumentURL(pp_instance());
152 153
153 handler_ = new CompletionHandler(AsWeakPtr()); 154 handler_ = new CompletionHandler(AsWeakPtr());
154 RenderViewImpl* render_view = static_cast<RenderViewImpl*>( 155 RenderViewImpl* render_view = static_cast<RenderViewImpl*>(
155 renderer_ppapi_host_->GetRenderViewForInstance(pp_instance())); 156 renderer_ppapi_host_->GetRenderViewForInstance(pp_instance()));
156 if (!render_view || !render_view->runFileChooser(params, handler_)) { 157 if (!render_view || !render_view->runFileChooser(params, handler_)) {
157 delete handler_; 158 delete handler_;
158 handler_ = NULL; 159 handler_ = NULL;
159 return PP_ERROR_NOACCESS; 160 return PP_ERROR_NOACCESS;
160 } 161 }
161 162
(...skipping 21 matching lines...) Expand all
183 } 184 }
184 185
185 reply_context_.params.set_result(PP_OK); 186 reply_context_.params.set_result(PP_OK);
186 host()->SendReply(reply_context_, 187 host()->SendReply(reply_context_,
187 PpapiPluginMsg_FileChooser_ShowReply(chosen_files)); 188 PpapiPluginMsg_FileChooser_ShowReply(chosen_files));
188 reply_context_ = ppapi::host::ReplyMessageContext(); 189 reply_context_ = ppapi::host::ReplyMessageContext();
189 handler_ = NULL; // Handler deletes itself. 190 handler_ = NULL; // Handler deletes itself.
190 } 191 }
191 192
192 } // namespace content 193 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/file_chooser_params.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698