| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/file_manager/fileapi_util.h" | 5 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
| 6 | 6 |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system_util.h" | 9 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 10 #include "chrome/browser/extensions/extension_util.h" | 10 #include "chrome/browser/extensions/extension_util.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 | 167 |
| 168 // Check the entry type. | 168 // Check the entry type. |
| 169 if (iterator->is_directory && | 169 if (iterator->is_directory && |
| 170 type == fileapi::FileSystemContext::RESOLVED_ENTRY_FILE) { | 170 type == fileapi::FileSystemContext::RESOLVED_ENTRY_FILE) { |
| 171 OnIteratorConverted(self_deleter.Pass(), | 171 OnIteratorConverted(self_deleter.Pass(), |
| 172 iterator, | 172 iterator, |
| 173 CreateEntryDefinitionWithError( | 173 CreateEntryDefinitionWithError( |
| 174 base::File::FILE_ERROR_NOT_A_DIRECTORY)); | 174 base::File::FILE_ERROR_NOT_A_DIRECTORY)); |
| 175 return; |
| 175 } | 176 } |
| 176 if (!iterator->is_directory && | 177 if (!iterator->is_directory && |
| 177 type == fileapi::FileSystemContext::RESOLVED_ENTRY_DIRECTORY) { | 178 type == fileapi::FileSystemContext::RESOLVED_ENTRY_DIRECTORY) { |
| 178 OnIteratorConverted(self_deleter.Pass(), | 179 OnIteratorConverted(self_deleter.Pass(), |
| 179 iterator, | 180 iterator, |
| 180 CreateEntryDefinitionWithError( | 181 CreateEntryDefinitionWithError( |
| 181 base::File::FILE_ERROR_NOT_A_FILE)); | 182 base::File::FILE_ERROR_NOT_A_FILE)); |
| 183 return; |
| 182 } | 184 } |
| 183 | 185 |
| 184 EntryDefinition entry_definition; | 186 EntryDefinition entry_definition; |
| 185 entry_definition.file_system_root_url = info.root_url.spec(); | 187 entry_definition.file_system_root_url = info.root_url.spec(); |
| 186 entry_definition.file_system_name = info.name; | 188 entry_definition.file_system_name = info.name; |
| 187 entry_definition.is_directory = iterator->is_directory; | 189 entry_definition.is_directory = iterator->is_directory; |
| 188 entry_definition.error = base::File::FILE_OK; | 190 entry_definition.error = base::File::FILE_OK; |
| 189 | 191 |
| 190 // Construct a target Entry.fullPath value from the virtual path and the | 192 // Construct a target Entry.fullPath value from the virtual path and the |
| 191 // root URL. Eg. Downloads/A/b.txt -> A/b.txt. | 193 // root URL. Eg. Downloads/A/b.txt -> A/b.txt. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 file_definition_list.push_back(file_definition); | 331 file_definition_list.push_back(file_definition); |
| 330 ConvertFileDefinitionListToEntryDefinitionList( | 332 ConvertFileDefinitionListToEntryDefinitionList( |
| 331 profile, | 333 profile, |
| 332 extension_id, | 334 extension_id, |
| 333 file_definition_list, | 335 file_definition_list, |
| 334 base::Bind(&OnConvertFileDefinitionDone, callback)); | 336 base::Bind(&OnConvertFileDefinitionDone, callback)); |
| 335 } | 337 } |
| 336 | 338 |
| 337 } // namespace util | 339 } // namespace util |
| 338 } // namespace file_manager | 340 } // namespace file_manager |
| OLD | NEW |