| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 347 |
| 348 // If sync isn't allowed, the only thing to do is to turn it off. | 348 // If sync isn't allowed, the only thing to do is to turn it off. |
| 349 if (!IsSyncAllowed()) { | 349 if (!IsSyncAllowed()) { |
| 350 // Only clear data if disallowed by policy. | 350 // Only clear data if disallowed by policy. |
| 351 RequestStop(IsManaged() ? CLEAR_DATA : KEEP_DATA); | 351 RequestStop(IsManaged() ? CLEAR_DATA : KEEP_DATA); |
| 352 return; | 352 return; |
| 353 } | 353 } |
| 354 | 354 |
| 355 RegisterAuthNotifications(); | 355 RegisterAuthNotifications(); |
| 356 | 356 |
| 357 if (!IsFirstSetupComplete() || !IsSignedIn()) { | 357 if (!IsSignedIn()) { |
| 358 // Clean up in case of previous crash / setup abort / signout. | 358 // Clean up in case of previous crash during signout. |
| 359 StopImpl(CLEAR_DATA); | 359 StopImpl(CLEAR_DATA); |
| 360 } | 360 } |
| 361 | 361 |
| 362 TrySyncDatatypePrefRecovery(); | 362 TrySyncDatatypePrefRecovery(); |
| 363 | 363 |
| 364 #if defined(OS_CHROMEOS) | 364 #if defined(OS_CHROMEOS) |
| 365 std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken(); | 365 std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken(); |
| 366 if (bootstrap_token.empty()) { | 366 if (bootstrap_token.empty()) { |
| 367 sync_prefs_.SetEncryptionBootstrapToken( | 367 sync_prefs_.SetEncryptionBootstrapToken( |
| 368 sync_prefs_.GetSpareBootstrapToken()); | 368 sync_prefs_.GetSpareBootstrapToken()); |
| (...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2532 } | 2532 } |
| 2533 | 2533 |
| 2534 std::string ProfileSyncService::unrecoverable_error_message() const { | 2534 std::string ProfileSyncService::unrecoverable_error_message() const { |
| 2535 return unrecoverable_error_message_; | 2535 return unrecoverable_error_message_; |
| 2536 } | 2536 } |
| 2537 | 2537 |
| 2538 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() | 2538 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() |
| 2539 const { | 2539 const { |
| 2540 return unrecoverable_error_location_; | 2540 return unrecoverable_error_location_; |
| 2541 } | 2541 } |
| OLD | NEW |