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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/drive/drive_api_service.h" | 10 #include "chrome/browser/drive/drive_api_service.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 continue; | 191 continue; |
192 | 192 |
193 // Pick an orphaned folder or a direct child of the root folder and | 193 // Pick an orphaned folder or a direct child of the root folder and |
194 // ignore others. | 194 // ignore others. |
195 DCHECK(!root_folder_id_.empty()); | 195 DCHECK(!root_folder_id_.empty()); |
196 if (!HasNoParents(*entry) && !HasFolderAsParent(*entry, root_folder_id_)) | 196 if (!HasNoParents(*entry) && !HasFolderAsParent(*entry, root_folder_id_)) |
197 continue; | 197 continue; |
198 | 198 |
199 if (!sync_root_folder_ || LessOnCreationTime(*entry, *sync_root_folder_)) { | 199 if (!sync_root_folder_ || LessOnCreationTime(*entry, *sync_root_folder_)) { |
200 sync_root_folder_.reset(entry); | 200 sync_root_folder_.reset(entry); |
201 *itr = NULL; | 201 *itr = nullptr; |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 set_used_network(true); | 205 set_used_network(true); |
206 // If there are more results, retrieve them. | 206 // If there are more results, retrieve them. |
207 if (!file_list->next_link().is_empty()) { | 207 if (!file_list->next_link().is_empty()) { |
208 cancel_callback_ = sync_context_->GetDriveService()->GetRemainingFileList( | 208 cancel_callback_ = sync_context_->GetDriveService()->GetRemainingFileList( |
209 file_list->next_link(), | 209 file_list->next_link(), |
210 base::Bind(&SyncEngineInitializer::DidFindSyncRoot, | 210 base::Bind(&SyncEngineInitializer::DidFindSyncRoot, |
211 weak_ptr_factory_.GetWeakPtr(), | 211 weak_ptr_factory_.GetWeakPtr(), |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 return; | 349 return; |
350 } | 350 } |
351 | 351 |
352 util::Log(logging::LOG_VERBOSE, FROM_HERE, | 352 util::Log(logging::LOG_VERBOSE, FROM_HERE, |
353 "[Initialize] Completed successfully."); | 353 "[Initialize] Completed successfully."); |
354 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_OK); | 354 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_OK); |
355 } | 355 } |
356 | 356 |
357 } // namespace drive_backend | 357 } // namespace drive_backend |
358 } // namespace sync_file_system | 358 } // namespace sync_file_system |
OLD | NEW |