| 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 <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "apps/saved_files_service.h" | 10 #include "apps/saved_files_service.h" |
| (...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 content::BrowserContext::GetStoragePartitionForSite(GetProfile(), site) | 1142 content::BrowserContext::GetStoragePartitionForSite(GetProfile(), site) |
| 1143 ->GetFileSystemContext(); | 1143 ->GetFileSystemContext(); |
| 1144 const storage::FileSystemURL url = context->CreateCrackedFileSystemURL( | 1144 const storage::FileSystemURL url = context->CreateCrackedFileSystemURL( |
| 1145 site, | 1145 site, |
| 1146 storage::kFileSystemTypeIsolated, | 1146 storage::kFileSystemTypeIsolated, |
| 1147 IsolatedContext::GetInstance() | 1147 IsolatedContext::GetInstance() |
| 1148 ->CreateVirtualRootPath(filesystem_id) | 1148 ->CreateVirtualRootPath(filesystem_id) |
| 1149 .Append(base::FilePath::FromUTF8Unsafe(filesystem_path))); | 1149 .Append(base::FilePath::FromUTF8Unsafe(filesystem_path))); |
| 1150 | 1150 |
| 1151 content::BrowserThread::PostTask( | 1151 content::BrowserThread::PostTask( |
| 1152 content::BrowserThread::IO, | 1152 content::BrowserThread::IO, FROM_HERE, |
| 1153 FROM_HERE, | |
| 1154 base::Bind( | 1153 base::Bind( |
| 1155 base::IgnoreResult( | 1154 base::IgnoreResult( |
| 1156 &storage::FileSystemOperationRunner::GetMetadata), | 1155 &storage::FileSystemOperationRunner::GetMetadata), |
| 1157 context->operation_runner()->AsWeakPtr(), | 1156 context->operation_runner()->AsWeakPtr(), url, |
| 1158 url, | 1157 storage::FileSystemOperation::GET_METADATA_FIELD_IS_DIRECTORY, |
| 1159 base::Bind( | 1158 base::Bind( |
| 1160 &PassFileInfoToUIThread, | 1159 &PassFileInfoToUIThread, |
| 1161 base::Bind(&FileSystemRetainEntryFunction::RetainFileEntry, | 1160 base::Bind(&FileSystemRetainEntryFunction::RetainFileEntry, |
| 1162 this, | 1161 this, entry_id, path)))); |
| 1163 entry_id, | |
| 1164 path)))); | |
| 1165 return true; | 1162 return true; |
| 1166 } | 1163 } |
| 1167 | 1164 |
| 1168 saved_files_service->EnqueueFileEntry(extension_->id(), entry_id); | 1165 saved_files_service->EnqueueFileEntry(extension_->id(), entry_id); |
| 1169 SendResponse(true); | 1166 SendResponse(true); |
| 1170 return true; | 1167 return true; |
| 1171 } | 1168 } |
| 1172 | 1169 |
| 1173 void FileSystemRetainEntryFunction::RetainFileEntry( | 1170 void FileSystemRetainEntryFunction::RetainFileEntry( |
| 1174 const std::string& entry_id, | 1171 const std::string& entry_id, |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 std::vector<linked_ptr<Volume>> result_volume_list; | 1437 std::vector<linked_ptr<Volume>> result_volume_list; |
| 1441 FillVolumeList(chrome_details_.GetProfile(), &result_volume_list); | 1438 FillVolumeList(chrome_details_.GetProfile(), &result_volume_list); |
| 1442 | 1439 |
| 1443 return RespondNow( | 1440 return RespondNow( |
| 1444 ArgumentList(api::file_system::GetVolumeList::Results::Create( | 1441 ArgumentList(api::file_system::GetVolumeList::Results::Create( |
| 1445 result_volume_list).Pass())); | 1442 result_volume_list).Pass())); |
| 1446 } | 1443 } |
| 1447 #endif | 1444 #endif |
| 1448 | 1445 |
| 1449 } // namespace extensions | 1446 } // namespace extensions |
| OLD | NEW |