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 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2131 return; | 2131 return; |
2132 } | 2132 } |
2133 | 2133 |
2134 SaveFeed(data.Pass(), FilePath(kAccountMetadataFile)); | 2134 SaveFeed(data.Pass(), FilePath(kAccountMetadataFile)); |
2135 | 2135 |
2136 callback.Run(base::PLATFORM_FILE_OK, | 2136 callback.Run(base::PLATFORM_FILE_OK, |
2137 feed->quota_bytes_total(), | 2137 feed->quota_bytes_total(), |
2138 feed->quota_bytes_used()); | 2138 feed->quota_bytes_used()); |
2139 } | 2139 } |
2140 | 2140 |
2141 std::vector<GDataOperationRegistry::ProgressStatus> | 2141 GDataOperationRegistry* GDataFileSystem::GetOperationRegistry() { |
2142 GDataFileSystem::GetProgressStatusList() { | 2142 return documents_service_->operation_registry(); |
2143 return documents_service_->operation_registry()->GetProgressStatusList(); | |
2144 } | 2143 } |
2145 | 2144 |
2146 bool GDataFileSystem::CancelOperation(const FilePath& file_path) { | |
2147 return documents_service_->operation_registry()->CancelForFilePath(file_path); | |
2148 } | |
2149 | |
2150 void GDataFileSystem::AddOperationObserver( | |
2151 GDataOperationRegistry::Observer* observer) { | |
2152 return documents_service_->operation_registry()->AddObserver(observer); | |
2153 } | |
2154 | |
2155 void GDataFileSystem::RemoveOperationObserver( | |
2156 GDataOperationRegistry::Observer* observer) { | |
2157 return documents_service_->operation_registry()->RemoveObserver(observer); | |
2158 } | |
2159 | |
2160 | |
2161 void GDataFileSystem::OnCreateDirectoryCompleted( | 2145 void GDataFileSystem::OnCreateDirectoryCompleted( |
2162 const CreateDirectoryParams& params, | 2146 const CreateDirectoryParams& params, |
2163 GDataErrorCode status, | 2147 GDataErrorCode status, |
2164 scoped_ptr<base::Value> data) { | 2148 scoped_ptr<base::Value> data) { |
2165 | 2149 |
2166 base::PlatformFileError error = GDataToPlatformError(status); | 2150 base::PlatformFileError error = GDataToPlatformError(status); |
2167 if (error != base::PLATFORM_FILE_OK) { | 2151 if (error != base::PLATFORM_FILE_OK) { |
2168 if (!params.callback.is_null()) | 2152 if (!params.callback.is_null()) |
2169 params.callback.Run(error); | 2153 params.callback.Run(error); |
2170 | 2154 |
(...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4292 pref_registrar_->Init(profile_->GetPrefs()); | 4276 pref_registrar_->Init(profile_->GetPrefs()); |
4293 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); | 4277 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); |
4294 } | 4278 } |
4295 | 4279 |
4296 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { | 4280 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { |
4297 delete global_free_disk_getter_for_testing; // Safe to delete NULL; | 4281 delete global_free_disk_getter_for_testing; // Safe to delete NULL; |
4298 global_free_disk_getter_for_testing = getter; | 4282 global_free_disk_getter_for_testing = getter; |
4299 } | 4283 } |
4300 | 4284 |
4301 } // namespace gdata | 4285 } // namespace gdata |
OLD | NEW |