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 "chrome/browser/extensions/api/file_system/file_system_api.h" | 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 if (accept_option.extensions.get()) { | 227 if (accept_option.extensions.get()) { |
228 std::vector<std::string>* list = accept_option.extensions.get(); | 228 std::vector<std::string>* list = accept_option.extensions.get(); |
229 for (std::vector<std::string>::const_iterator iter = list->begin(); | 229 for (std::vector<std::string>::const_iterator iter = list->begin(); |
230 iter != list->end(); ++iter) { | 230 iter != list->end(); ++iter) { |
231 std::string extension = *iter; | 231 std::string extension = *iter; |
232 StringToLowerASCII(&extension); | 232 StringToLowerASCII(&extension); |
233 #if defined(OS_WIN) | 233 #if defined(OS_WIN) |
234 extension_set.insert(UTF8ToWide(*iter)); | 234 extension_set.insert(base::UTF8ToWide(*iter)); |
235 #else | 235 #else |
236 extension_set.insert(*iter); | 236 extension_set.insert(*iter); |
237 #endif | 237 #endif |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 extensions->assign(extension_set.begin(), extension_set.end()); | 241 extensions->assign(extension_set.begin(), extension_set.end()); |
242 if (extensions->empty()) | 242 if (extensions->empty()) |
243 return false; | 243 return false; |
244 | 244 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 | 595 |
596 if (entry_type == WRITABLE && !HasFileSystemWritePermission()) { | 596 if (entry_type == WRITABLE && !HasFileSystemWritePermission()) { |
597 error_ = kRequiresFileSystemWriteError; | 597 error_ = kRequiresFileSystemWriteError; |
598 return false; | 598 return false; |
599 } | 599 } |
600 | 600 |
601 return ShowPicker(suggested_name, file_type_info, picker_type, entry_type); | 601 return ShowPicker(suggested_name, file_type_info, picker_type, entry_type); |
602 } | 602 } |
603 | 603 |
604 } // namespace extensions | 604 } // namespace extensions |
OLD | NEW |