| 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 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2352 return NULL; | 2352 return NULL; |
| 2353 return signin_->GetOriginal(); | 2353 return signin_->GetOriginal(); |
| 2354 } | 2354 } |
| 2355 | 2355 |
| 2356 void ProfileSyncService::RequestStart() { | 2356 void ProfileSyncService::RequestStart() { |
| 2357 if (!IsSyncAllowed()) { | 2357 if (!IsSyncAllowed()) { |
| 2358 // Sync cannot be requested if it's not allowed. | 2358 // Sync cannot be requested if it's not allowed. |
| 2359 return; | 2359 return; |
| 2360 } | 2360 } |
| 2361 DCHECK(sync_client_); | 2361 DCHECK(sync_client_); |
| 2362 sync_prefs_.SetSyncRequested(true); | 2362 if (!IsSyncRequested()) { |
| 2363 DCHECK(!signin_.get() || signin_->GetOriginal()->IsAuthenticated()); | 2363 sync_prefs_.SetSyncRequested(true); |
| 2364 NotifyObservers(); |
| 2365 } |
| 2364 startup_controller_->TryStart(); | 2366 startup_controller_->TryStart(); |
| 2365 } | 2367 } |
| 2366 | 2368 |
| 2367 void ProfileSyncService::ReconfigureDatatypeManager() { | 2369 void ProfileSyncService::ReconfigureDatatypeManager() { |
| 2368 // If we haven't initialized yet, don't configure the DTM as it could cause | 2370 // If we haven't initialized yet, don't configure the DTM as it could cause |
| 2369 // association to start before a Directory has even been created. | 2371 // association to start before a Directory has even been created. |
| 2370 if (backend_initialized_) { | 2372 if (backend_initialized_) { |
| 2371 DCHECK(backend_.get()); | 2373 DCHECK(backend_.get()); |
| 2372 ConfigureDataTypeManager(); | 2374 ConfigureDataTypeManager(); |
| 2373 } else if (HasUnrecoverableError()) { | 2375 } else if (HasUnrecoverableError()) { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2537 } | 2539 } |
| 2538 | 2540 |
| 2539 std::string ProfileSyncService::unrecoverable_error_message() const { | 2541 std::string ProfileSyncService::unrecoverable_error_message() const { |
| 2540 return unrecoverable_error_message_; | 2542 return unrecoverable_error_message_; |
| 2541 } | 2543 } |
| 2542 | 2544 |
| 2543 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() | 2545 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() |
| 2544 const { | 2546 const { |
| 2545 return unrecoverable_error_location_; | 2547 return unrecoverable_error_location_; |
| 2546 } | 2548 } |
| OLD | NEW |