| 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/chromeos/gdata/gdata_file_system.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/eintr_wrapper.h" | 10 #include "base/eintr_wrapper.h" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 13 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/message_loop_proxy.h" | 15 #include "base/message_loop_proxy.h" |
| 16 #include "base/platform_file.h" | 16 #include "base/platform_file.h" |
| 17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/chromeos/gdata/gdata.h" | 20 #include "chrome/browser/chromeos/gdata/gdata.h" |
| 21 #include "chrome/browser/chromeos/gdata/gdata_download_observer.h" | 21 #include "chrome/browser/chromeos/gdata/gdata_download_observer.h" |
| 22 #include "chrome/browser/chromeos/gdata/gdata_parser.h" | |
| 23 #include "chrome/browser/download/download_service.h" | 22 #include "chrome/browser/download/download_service.h" |
| 24 #include "chrome/browser/download/download_service_factory.h" | 23 #include "chrome/browser/download/download_service_factory.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/profiles/profile_dependency_manager.h" | 25 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 27 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
| 28 #include "chrome/common/chrome_paths_internal.h" | 27 #include "chrome/common/chrome_paths_internal.h" |
| 29 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 30 #include "webkit/fileapi/file_system_file_util_proxy.h" | 29 #include "webkit/fileapi/file_system_file_util_proxy.h" |
| 31 #include "webkit/fileapi/file_system_types.h" | 30 #include "webkit/fileapi/file_system_types.h" |
| 32 #include "webkit/fileapi/file_system_util.h" | 31 #include "webkit/fileapi/file_system_util.h" |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 return; | 1215 return; |
| 1217 } | 1216 } |
| 1218 | 1217 |
| 1219 SaveFeed(data.Pass(), FilePath(kAccountMetadataFile)); | 1218 SaveFeed(data.Pass(), FilePath(kAccountMetadataFile)); |
| 1220 | 1219 |
| 1221 callback.Run(base::PLATFORM_FILE_OK, | 1220 callback.Run(base::PLATFORM_FILE_OK, |
| 1222 feed->quota_bytes_total(), | 1221 feed->quota_bytes_total(), |
| 1223 feed->quota_bytes_used()); | 1222 feed->quota_bytes_used()); |
| 1224 } | 1223 } |
| 1225 | 1224 |
| 1225 std::vector<GDataOperationRegistry::ProgressStatus> |
| 1226 GDataFileSystem::GetProgressStatusList() { |
| 1227 return documents_service_->operation_registry()->GetProgressStatusList(); |
| 1228 } |
| 1229 |
| 1230 void GDataFileSystem::AddOperationObserver( |
| 1231 GDataOperationRegistry::Observer* observer) { |
| 1232 return documents_service_->operation_registry()->AddObserver(observer); |
| 1233 } |
| 1234 |
| 1235 void GDataFileSystem::RemoveOperationObserver( |
| 1236 GDataOperationRegistry::Observer* observer) { |
| 1237 return documents_service_->operation_registry()->RemoveObserver(observer); |
| 1238 } |
| 1239 |
| 1240 |
| 1226 void GDataFileSystem::OnCreateDirectoryCompleted( | 1241 void GDataFileSystem::OnCreateDirectoryCompleted( |
| 1227 const CreateDirectoryParams& params, | 1242 const CreateDirectoryParams& params, |
| 1228 GDataErrorCode status, | 1243 GDataErrorCode status, |
| 1229 scoped_ptr<base::Value> data) { | 1244 scoped_ptr<base::Value> data) { |
| 1230 | 1245 |
| 1231 base::PlatformFileError error = GDataToPlatformError(status); | 1246 base::PlatformFileError error = GDataToPlatformError(status); |
| 1232 if (error != base::PLATFORM_FILE_OK) { | 1247 if (error != base::PLATFORM_FILE_OK) { |
| 1233 if (!params.callback.is_null()) | 1248 if (!params.callback.is_null()) |
| 1234 params.callback.Run(error); | 1249 params.callback.Run(error); |
| 1235 | 1250 |
| (...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2251 | 2266 |
| 2252 GDataFileSystemFactory::~GDataFileSystemFactory() { | 2267 GDataFileSystemFactory::~GDataFileSystemFactory() { |
| 2253 } | 2268 } |
| 2254 | 2269 |
| 2255 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( | 2270 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( |
| 2256 Profile* profile) const { | 2271 Profile* profile) const { |
| 2257 return new GDataFileSystem(profile, new DocumentsService); | 2272 return new GDataFileSystem(profile, new DocumentsService); |
| 2258 } | 2273 } |
| 2259 | 2274 |
| 2260 } // namespace gdata | 2275 } // namespace gdata |
| OLD | NEW |