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

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

Issue 1282363003: Convert remaining StringToLowerASCII to ToLowerASCII (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « pdf/pdfium/pdfium_page.cc ('k') | remoting/signaling/jid_util.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/strings/string_split.h" 8 #include "base/strings/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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 std::string type = type_list[i]; 86 std::string type = type_list[i];
87 base::TrimWhitespaceASCII(type, base::TRIM_ALL, &type); 87 base::TrimWhitespaceASCII(type, base::TRIM_ALL, &type);
88 88
89 // If the type is a single character, it definitely cannot be valid. In the 89 // If the type is a single character, it definitely cannot be valid. In the
90 // case of a file extension it would be a single ".". In the case of a MIME 90 // case of a file extension it would be a single ".". In the case of a MIME
91 // type it would just be a "/". 91 // type it would just be a "/".
92 if (type.length() < 2) 92 if (type.length() < 2)
93 continue; 93 continue;
94 if (type.find_first_of('/') == std::string::npos && type[0] != '.') 94 if (type.find_first_of('/') == std::string::npos && type[0] != '.')
95 continue; 95 continue;
96 base::StringToLowerASCII(&type); 96 output->push_back(base::ToLowerASCII(type));
97 output->push_back(type);
98 } 97 }
99 } 98 }
100 99
101 void FileChooserResource::OnPluginMsgShowReply( 100 void FileChooserResource::OnPluginMsgShowReply(
102 const ResourceMessageReplyParams& params, 101 const ResourceMessageReplyParams& params,
103 const std::vector<FileRefCreateInfo>& chosen_files) { 102 const std::vector<FileRefCreateInfo>& chosen_files) {
104 if (output_.is_valid()) { 103 if (output_.is_valid()) {
105 // Using v0.6 of the API with the output array. 104 // Using v0.6 of the API with the output array.
106 std::vector<PP_Resource> files; 105 std::vector<PP_Resource> files;
107 for (size_t i = 0; i < chosen_files.size(); i++) { 106 for (size_t i = 0; i < chosen_files.size(); i++) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 mode_ == PP_FILECHOOSERMODE_OPENMULTIPLE, 145 mode_ == PP_FILECHOOSERMODE_OPENMULTIPLE,
147 sugg_str ? sugg_str->value() : std::string(), 146 sugg_str ? sugg_str->value() : std::string(),
148 accept_types_); 147 accept_types_);
149 Call<PpapiPluginMsg_FileChooser_ShowReply>(RENDERER, msg, 148 Call<PpapiPluginMsg_FileChooser_ShowReply>(RENDERER, msg,
150 base::Bind(&FileChooserResource::OnPluginMsgShowReply, this)); 149 base::Bind(&FileChooserResource::OnPluginMsgShowReply, this));
151 return PP_OK_COMPLETIONPENDING; 150 return PP_OK_COMPLETIONPENDING;
152 } 151 }
153 152
154 } // namespace proxy 153 } // namespace proxy
155 } // namespace ppapi 154 } // namespace ppapi
OLDNEW
« no previous file with comments | « pdf/pdfium/pdfium_page.cc ('k') | remoting/signaling/jid_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698