| 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/sync_file_system/drive_backend/sync_engine_initializer.
h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.
h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 return; | 281 return; |
| 282 } | 282 } |
| 283 | 283 |
| 284 ListAppRootFolders(std::move(token)); | 284 ListAppRootFolders(std::move(token)); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void SyncEngineInitializer::ListAppRootFolders( | 287 void SyncEngineInitializer::ListAppRootFolders( |
| 288 std::unique_ptr<SyncTaskToken> token) { | 288 std::unique_ptr<SyncTaskToken> token) { |
| 289 DCHECK(sync_root_folder_); | 289 DCHECK(sync_root_folder_); |
| 290 set_used_network(true); | 290 set_used_network(true); |
| 291 cancel_callback_ = | 291 cancel_callback_ = sync_context_->GetDriveService()->GetFileListInDirectory( |
| 292 sync_context_->GetDriveService()->GetFileListInDirectory( | 292 sync_root_folder_->file_id(), "" /* team_drive_id */, |
| 293 sync_root_folder_->file_id(), | 293 base::Bind(&SyncEngineInitializer::DidListAppRootFolders, |
| 294 base::Bind(&SyncEngineInitializer::DidListAppRootFolders, | 294 weak_ptr_factory_.GetWeakPtr(), base::Passed(&token))); |
| 295 weak_ptr_factory_.GetWeakPtr(), | |
| 296 base::Passed(&token))); | |
| 297 } | 295 } |
| 298 | 296 |
| 299 void SyncEngineInitializer::DidListAppRootFolders( | 297 void SyncEngineInitializer::DidListAppRootFolders( |
| 300 std::unique_ptr<SyncTaskToken> token, | 298 std::unique_ptr<SyncTaskToken> token, |
| 301 google_apis::DriveApiErrorCode error, | 299 google_apis::DriveApiErrorCode error, |
| 302 std::unique_ptr<google_apis::FileList> file_list) { | 300 std::unique_ptr<google_apis::FileList> file_list) { |
| 303 cancel_callback_.Reset(); | 301 cancel_callback_.Reset(); |
| 304 | 302 |
| 305 SyncStatusCode status = DriveApiErrorCodeToSyncStatusCode(error); | 303 SyncStatusCode status = DriveApiErrorCodeToSyncStatusCode(error); |
| 306 if (status != SYNC_STATUS_OK) { | 304 if (status != SYNC_STATUS_OK) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 return; | 349 return; |
| 352 } | 350 } |
| 353 | 351 |
| 354 util::Log(logging::LOG_VERBOSE, FROM_HERE, | 352 util::Log(logging::LOG_VERBOSE, FROM_HERE, |
| 355 "[Initialize] Completed successfully."); | 353 "[Initialize] Completed successfully."); |
| 356 SyncTaskManager::NotifyTaskDone(std::move(token), SYNC_STATUS_OK); | 354 SyncTaskManager::NotifyTaskDone(std::move(token), SYNC_STATUS_OK); |
| 357 } | 355 } |
| 358 | 356 |
| 359 } // namespace drive_backend | 357 } // namespace drive_backend |
| 360 } // namespace sync_file_system | 358 } // namespace sync_file_system |
| OLD | NEW |