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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 scoped_ptr<ChooseEntry::Params> params(ChooseEntry::Params::Create(*args_)); | 1056 scoped_ptr<ChooseEntry::Params> params(ChooseEntry::Params::Create(*args_)); |
1057 EXTENSION_FUNCTION_VALIDATE(params.get()); | 1057 EXTENSION_FUNCTION_VALIDATE(params.get()); |
1058 | 1058 |
1059 base::FilePath suggested_name; | 1059 base::FilePath suggested_name; |
1060 ui::SelectFileDialog::FileTypeInfo file_type_info; | 1060 ui::SelectFileDialog::FileTypeInfo file_type_info; |
1061 ui::SelectFileDialog::Type picker_type = | 1061 ui::SelectFileDialog::Type picker_type = |
1062 ui::SelectFileDialog::SELECT_OPEN_FILE; | 1062 ui::SelectFileDialog::SELECT_OPEN_FILE; |
1063 | 1063 |
1064 file_system::ChooseEntryOptions* options = params->options.get(); | 1064 file_system::ChooseEntryOptions* options = params->options.get(); |
1065 if (options) { | 1065 if (options) { |
1066 multiple_ = options->accepts_multiple; | 1066 multiple_ = !!options->accepts_multiple; |
1067 if (multiple_) | 1067 if (multiple_) |
1068 picker_type = ui::SelectFileDialog::SELECT_OPEN_MULTI_FILE; | 1068 picker_type = ui::SelectFileDialog::SELECT_OPEN_MULTI_FILE; |
1069 | 1069 |
1070 if (options->type == file_system::CHOOSE_ENTRY_TYPE_OPENWRITABLEFILE && | 1070 if (options->type == file_system::CHOOSE_ENTRY_TYPE_OPENWRITABLEFILE && |
1071 !app_file_handler_util::HasFileSystemWritePermission( | 1071 !app_file_handler_util::HasFileSystemWritePermission( |
1072 extension_.get())) { | 1072 extension_.get())) { |
1073 error_ = kRequiresFileSystemWriteError; | 1073 error_ = kRequiresFileSystemWriteError; |
1074 return false; | 1074 return false; |
1075 } else if (options->type == file_system::CHOOSE_ENTRY_TYPE_SAVEFILE) { | 1075 } else if (options->type == file_system::CHOOSE_ENTRY_TYPE_SAVEFILE) { |
1076 if (!app_file_handler_util::HasFileSystemWritePermission( | 1076 if (!app_file_handler_util::HasFileSystemWritePermission( |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 using api::file_system::Volume; | 1457 using api::file_system::Volume; |
1458 std::vector<linked_ptr<Volume>> result_volume_list; | 1458 std::vector<linked_ptr<Volume>> result_volume_list; |
1459 FillVolumeList(chrome_details_.GetProfile(), &result_volume_list); | 1459 FillVolumeList(chrome_details_.GetProfile(), &result_volume_list); |
1460 | 1460 |
1461 return RespondNow(ArgumentList( | 1461 return RespondNow(ArgumentList( |
1462 api::file_system::GetVolumeList::Results::Create(result_volume_list))); | 1462 api::file_system::GetVolumeList::Results::Create(result_volume_list))); |
1463 } | 1463 } |
1464 #endif | 1464 #endif |
1465 | 1465 |
1466 } // namespace extensions | 1466 } // namespace extensions |
OLD | NEW |