| 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 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2534 | 2534 |
| 2535 SigninManagerBase* ProfileSyncService::signin() const { | 2535 SigninManagerBase* ProfileSyncService::signin() const { |
| 2536 if (!signin_) | 2536 if (!signin_) |
| 2537 return NULL; | 2537 return NULL; |
| 2538 return signin_->GetOriginal(); | 2538 return signin_->GetOriginal(); |
| 2539 } | 2539 } |
| 2540 | 2540 |
| 2541 void ProfileSyncService::UnsuppressAndStart() { | 2541 void ProfileSyncService::UnsuppressAndStart() { |
| 2542 DCHECK(profile_); | 2542 DCHECK(profile_); |
| 2543 sync_prefs_.SetStartSuppressed(false); | 2543 sync_prefs_.SetStartSuppressed(false); |
| 2544 // Set username in SigninManager, as SigninManager::OnGetUserInfoSuccess | 2544 if (signin_.get() && !signin_->GetOriginal()->IsAuthenticated()) { |
| 2545 // is never called for some clients. | |
| 2546 if (signin_.get() && | |
| 2547 signin_->GetOriginal()->GetAuthenticatedUsername().empty()) { | |
| 2548 signin_->GetOriginal()->SetAuthenticatedUsername( | 2545 signin_->GetOriginal()->SetAuthenticatedUsername( |
| 2549 profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername)); | 2546 profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername)); |
| 2550 } | 2547 } |
| 2551 startup_controller_.TryStart(); | 2548 startup_controller_.TryStart(); |
| 2552 } | 2549 } |
| 2553 | 2550 |
| 2554 void ProfileSyncService::AcknowledgeSyncedTypes() { | 2551 void ProfileSyncService::AcknowledgeSyncedTypes() { |
| 2555 sync_prefs_.AcknowledgeSyncedTypes(GetRegisteredDataTypes()); | 2552 sync_prefs_.AcknowledgeSyncedTypes(GetRegisteredDataTypes()); |
| 2556 } | 2553 } |
| 2557 | 2554 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2783 true)); | 2780 true)); |
| 2784 } | 2781 } |
| 2785 | 2782 |
| 2786 bool ProfileSyncService::NeedBackup() const { | 2783 bool ProfileSyncService::NeedBackup() const { |
| 2787 return need_backup_; | 2784 return need_backup_; |
| 2788 } | 2785 } |
| 2789 | 2786 |
| 2790 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { | 2787 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { |
| 2791 return backend_->GetSyncedDeviceTracker()->GetLocalDeviceBackupTime(); | 2788 return backend_->GetSyncedDeviceTracker()->GetLocalDeviceBackupTime(); |
| 2792 } | 2789 } |
| OLD | NEW |