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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 2483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2494 | 2494 |
2495 SigninManagerBase* ProfileSyncService::signin() const { | 2495 SigninManagerBase* ProfileSyncService::signin() const { |
2496 if (!signin_) | 2496 if (!signin_) |
2497 return NULL; | 2497 return NULL; |
2498 return signin_->GetOriginal(); | 2498 return signin_->GetOriginal(); |
2499 } | 2499 } |
2500 | 2500 |
2501 void ProfileSyncService::UnsuppressAndStart() { | 2501 void ProfileSyncService::UnsuppressAndStart() { |
2502 DCHECK(profile_); | 2502 DCHECK(profile_); |
2503 sync_prefs_.SetStartSuppressed(false); | 2503 sync_prefs_.SetStartSuppressed(false); |
2504 if (signin_.get() && !signin_->GetOriginal()->IsAuthenticated()) { | 2504 DCHECK(!signin_.get() || signin_->GetOriginal()->IsAuthenticated()); |
2505 signin_->GetOriginal()->SetAuthenticatedUsername( | |
2506 profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername)); | |
Nicolas Zea
2014/12/04 17:57:39
Is this no longer necessary? Was the signin manage
Roger Tawa OOO till Jul 10th
2014/12/04 22:26:47
Well, that's a question for you :-) Pavel tracked
| |
2507 } | |
2508 startup_controller_.TryStart(); | 2505 startup_controller_.TryStart(); |
2509 } | 2506 } |
2510 | 2507 |
2511 void ProfileSyncService::AcknowledgeSyncedTypes() { | 2508 void ProfileSyncService::AcknowledgeSyncedTypes() { |
2512 sync_prefs_.AcknowledgeSyncedTypes(GetRegisteredDataTypes()); | 2509 sync_prefs_.AcknowledgeSyncedTypes(GetRegisteredDataTypes()); |
2513 } | 2510 } |
2514 | 2511 |
2515 void ProfileSyncService::ReconfigureDatatypeManager() { | 2512 void ProfileSyncService::ReconfigureDatatypeManager() { |
2516 // If we haven't initialized yet, don't configure the DTM as it could cause | 2513 // If we haven't initialized yet, don't configure the DTM as it could cause |
2517 // association to start before a Directory has even been created. | 2514 // association to start before a Directory has even been created. |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2762 | 2759 |
2763 base::MessageLoop* ProfileSyncService::GetSyncLoopForTest() const { | 2760 base::MessageLoop* ProfileSyncService::GetSyncLoopForTest() const { |
2764 if (sync_thread_) { | 2761 if (sync_thread_) { |
2765 return sync_thread_->message_loop(); | 2762 return sync_thread_->message_loop(); |
2766 } else if (backend_) { | 2763 } else if (backend_) { |
2767 return backend_->GetSyncLoopForTesting(); | 2764 return backend_->GetSyncLoopForTesting(); |
2768 } else { | 2765 } else { |
2769 return NULL; | 2766 return NULL; |
2770 } | 2767 } |
2771 } | 2768 } |
OLD | NEW |