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 "components/browser_sync/browser/profile_sync_service.h" | 5 #include "components/browser_sync/browser/profile_sync_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 350 |
351 // If sync isn't allowed, the only thing to do is to turn it off. | 351 // If sync isn't allowed, the only thing to do is to turn it off. |
352 if (!IsSyncAllowed()) { | 352 if (!IsSyncAllowed()) { |
353 // Only clear data if disallowed by policy. | 353 // Only clear data if disallowed by policy. |
354 RequestStop(IsManaged() ? CLEAR_DATA : KEEP_DATA); | 354 RequestStop(IsManaged() ? CLEAR_DATA : KEEP_DATA); |
355 return; | 355 return; |
356 } | 356 } |
357 | 357 |
358 RegisterAuthNotifications(); | 358 RegisterAuthNotifications(); |
359 | 359 |
360 if (!IsFirstSetupComplete() || !IsSignedIn()) { | 360 if (!IsSignedIn()) { |
361 // Clean up in case of previous crash / setup abort / signout. | 361 // Clean up in case of previous crash during signout. |
362 StopImpl(CLEAR_DATA); | 362 StopImpl(CLEAR_DATA); |
363 } | 363 } |
364 | 364 |
365 #if defined(OS_CHROMEOS) | 365 #if defined(OS_CHROMEOS) |
366 std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken(); | 366 std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken(); |
367 if (bootstrap_token.empty()) { | 367 if (bootstrap_token.empty()) { |
368 sync_prefs_.SetEncryptionBootstrapToken( | 368 sync_prefs_.SetEncryptionBootstrapToken( |
369 sync_prefs_.GetSpareBootstrapToken()); | 369 sync_prefs_.GetSpareBootstrapToken()); |
370 } | 370 } |
371 #endif | 371 #endif |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2526 if (--outstanding_setup_in_progress_handles_ != 0) | 2526 if (--outstanding_setup_in_progress_handles_ != 0) |
2527 return; | 2527 return; |
2528 | 2528 |
2529 DCHECK(startup_controller_->IsSetupInProgress()); | 2529 DCHECK(startup_controller_->IsSetupInProgress()); |
2530 startup_controller_->SetSetupInProgress(false); | 2530 startup_controller_->SetSetupInProgress(false); |
2531 | 2531 |
2532 if (IsBackendInitialized()) | 2532 if (IsBackendInitialized()) |
2533 ReconfigureDatatypeManager(); | 2533 ReconfigureDatatypeManager(); |
2534 NotifyObservers(); | 2534 NotifyObservers(); |
2535 } | 2535 } |
OLD | NEW |