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 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2236 return; | 2236 return; |
2237 } | 2237 } |
2238 | 2238 |
2239 SaveFeed(data.Pass(), FilePath(kAccountMetadataFile)); | 2239 SaveFeed(data.Pass(), FilePath(kAccountMetadataFile)); |
2240 | 2240 |
2241 callback.Run(base::PLATFORM_FILE_OK, | 2241 callback.Run(base::PLATFORM_FILE_OK, |
2242 feed->quota_bytes_total(), | 2242 feed->quota_bytes_total(), |
2243 feed->quota_bytes_used()); | 2243 feed->quota_bytes_used()); |
2244 } | 2244 } |
2245 | 2245 |
2246 std::vector<GDataOperationRegistry::ProgressStatus> | 2246 GDataOperationRegistry* GDataFileSystem::GetOperationRegistry() { |
2247 GDataFileSystem::GetProgressStatusList() { | 2247 return documents_service_->operation_registry(); |
2248 return documents_service_->operation_registry()->GetProgressStatusList(); | |
2249 } | 2248 } |
2250 | 2249 |
2251 bool GDataFileSystem::CancelOperation(const FilePath& file_path) { | |
2252 return documents_service_->operation_registry()->CancelForFilePath(file_path); | |
2253 } | |
2254 | |
2255 void GDataFileSystem::AddOperationObserver( | |
2256 GDataOperationRegistry::Observer* observer) { | |
2257 return documents_service_->operation_registry()->AddObserver(observer); | |
2258 } | |
2259 | |
2260 void GDataFileSystem::RemoveOperationObserver( | |
2261 GDataOperationRegistry::Observer* observer) { | |
2262 return documents_service_->operation_registry()->RemoveObserver(observer); | |
2263 } | |
2264 | |
2265 | |
2266 void GDataFileSystem::OnCreateDirectoryCompleted( | 2250 void GDataFileSystem::OnCreateDirectoryCompleted( |
2267 const CreateDirectoryParams& params, | 2251 const CreateDirectoryParams& params, |
2268 GDataErrorCode status, | 2252 GDataErrorCode status, |
2269 scoped_ptr<base::Value> data) { | 2253 scoped_ptr<base::Value> data) { |
2270 | 2254 |
2271 base::PlatformFileError error = GDataToPlatformError(status); | 2255 base::PlatformFileError error = GDataToPlatformError(status); |
2272 if (error != base::PLATFORM_FILE_OK) { | 2256 if (error != base::PLATFORM_FILE_OK) { |
2273 if (!params.callback.is_null()) | 2257 if (!params.callback.is_null()) |
2274 params.callback.Run(error); | 2258 params.callback.Run(error); |
2275 | 2259 |
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4413 pref_registrar_->Init(profile_->GetPrefs()); | 4397 pref_registrar_->Init(profile_->GetPrefs()); |
4414 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); | 4398 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); |
4415 } | 4399 } |
4416 | 4400 |
4417 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { | 4401 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { |
4418 delete global_free_disk_getter_for_testing; // Safe to delete NULL; | 4402 delete global_free_disk_getter_for_testing; // Safe to delete NULL; |
4419 global_free_disk_getter_for_testing = getter; | 4403 global_free_disk_getter_for_testing = getter; |
4420 } | 4404 } |
4421 | 4405 |
4422 } // namespace gdata | 4406 } // namespace gdata |
OLD | NEW |