Chromium Code Reviews| 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/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1006 UpdateLastSyncedTime(); | 1006 UpdateLastSyncedTime(); |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 if (startup_controller_.auto_start_enabled() && !FirstSetupInProgress()) { | 1009 if (startup_controller_.auto_start_enabled() && !FirstSetupInProgress()) { |
| 1010 // Backend is initialized but we're not in sync setup, so this must be an | 1010 // Backend is initialized but we're not in sync setup, so this must be an |
| 1011 // autostart - mark our sync setup as completed and we'll start syncing | 1011 // autostart - mark our sync setup as completed and we'll start syncing |
| 1012 // below. | 1012 // below. |
| 1013 SetSyncSetupCompleted(); | 1013 SetSyncSetupCompleted(); |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 // Give the DataTypeControllers a handle to the now initialized backend | |
| 1017 // as a UserShare. | |
| 1018 for (DataTypeController::TypeMap::iterator it = | |
|
haitaol1
2014/06/05 22:07:04
This should be called at the beginning to set user
tim (not reviewing)
2014/06/06 18:52:53
Uh oh! Good catch. Are there backup/restore tests
haitaol1
2014/06/06 20:44:33
The integration test I'm submitting should be able
| |
| 1019 directory_data_type_controllers_.begin(); | |
| 1020 it != directory_data_type_controllers_.end(); ++it) { | |
| 1021 it->second->OnUserShareReady(GetUserShare()); | |
| 1022 } | |
| 1023 | |
| 1016 // Check HasSyncSetupCompleted() before NotifyObservers() to avoid spurious | 1024 // Check HasSyncSetupCompleted() before NotifyObservers() to avoid spurious |
| 1017 // data type configuration because observer may flag setup as complete and | 1025 // data type configuration because observer may flag setup as complete and |
| 1018 // trigger data type configuration. | 1026 // trigger data type configuration. |
| 1019 if (HasSyncSetupCompleted()) { | 1027 if (HasSyncSetupCompleted()) { |
| 1020 ConfigureDataTypeManager(); | 1028 ConfigureDataTypeManager(); |
| 1021 } else { | 1029 } else { |
| 1022 DCHECK(FirstSetupInProgress()); | 1030 DCHECK(FirstSetupInProgress()); |
| 1023 } | 1031 } |
| 1024 | 1032 |
| 1025 NotifyObservers(); | 1033 NotifyObservers(); |
| (...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2468 network_resources_ = network_resources.Pass(); | 2476 network_resources_ = network_resources.Pass(); |
| 2469 } | 2477 } |
| 2470 | 2478 |
| 2471 bool ProfileSyncService::HasSyncingBackend() const { | 2479 bool ProfileSyncService::HasSyncingBackend() const { |
| 2472 return backend_mode_ != SYNC ? false : backend_ != NULL; | 2480 return backend_mode_ != SYNC ? false : backend_ != NULL; |
| 2473 } | 2481 } |
| 2474 | 2482 |
| 2475 void ProfileSyncService::SetBackupStartDelayForTest(base::TimeDelta delay) { | 2483 void ProfileSyncService::SetBackupStartDelayForTest(base::TimeDelta delay) { |
| 2476 backup_start_delay_ = delay; | 2484 backup_start_delay_ = delay; |
| 2477 } | 2485 } |
| OLD | NEW |