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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/sync/glue/sync_backend_host.h" | 7 #include "chrome/browser/sync/glue/sync_backend_host.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 initialization_state_ = NOT_INITIALIZED; | 1155 initialization_state_ = NOT_INITIALIZED; |
1156 | 1156 |
1157 DCHECK_EQ(MessageLoop::current(), frontend_loop_); | 1157 DCHECK_EQ(MessageLoop::current(), frontend_loop_); |
1158 if (!success) { | 1158 if (!success) { |
1159 initialization_state_ = NOT_INITIALIZED; | 1159 initialization_state_ = NOT_INITIALIZED; |
1160 frontend_->OnBackendInitialized( | 1160 frontend_->OnBackendInitialized( |
1161 syncer::WeakHandle<syncer::JsBackend>(), false); | 1161 syncer::WeakHandle<syncer::JsBackend>(), false); |
1162 return; | 1162 return; |
1163 } | 1163 } |
1164 | 1164 |
| 1165 if (sync_prefs_->HasSyncSetupCompleted() && |
| 1166 initialization_state_ < DOWNLOADING_NIGORI) { |
| 1167 initialization_state_ = DOWNLOADING_NIGORI; |
| 1168 } |
| 1169 |
1165 // Run initialization state machine. | 1170 // Run initialization state machine. |
1166 switch (initialization_state_) { | 1171 switch (initialization_state_) { |
1167 case NOT_INITIALIZED: | 1172 case NOT_INITIALIZED: |
1168 initialization_state_ = DOWNLOADING_NIGORI; | 1173 initialization_state_ = DOWNLOADING_NIGORI; |
1169 ConfigureDataTypes( | 1174 ConfigureDataTypes( |
1170 syncer::CONFIGURE_REASON_NEW_CLIENT, | 1175 syncer::CONFIGURE_REASON_NEW_CLIENT, |
1171 syncer::ModelTypeSet(), | 1176 syncer::ModelTypeSet(), |
1172 syncer::ModelTypeSet(), | 1177 syncer::ModelTypeSet(), |
1173 WITH_NIGORI, | 1178 WITH_NIGORI, |
1174 // Calls back into this function. | 1179 // Calls back into this function. |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 FROM_HERE, | 1358 FROM_HERE, |
1354 base::Bind(&SyncBackendHost::Core::DoRefreshNigori, | 1359 base::Bind(&SyncBackendHost::Core::DoRefreshNigori, |
1355 core_.get(), sync_thread_done_callback)); | 1360 core_.get(), sync_thread_done_callback)); |
1356 } | 1361 } |
1357 | 1362 |
1358 #undef SDVLOG | 1363 #undef SDVLOG |
1359 | 1364 |
1360 #undef SLOG | 1365 #undef SLOG |
1361 | 1366 |
1362 } // namespace browser_sync | 1367 } // namespace browser_sync |
OLD | NEW |