| 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/profile_sync_service.h" | 5 #include "components/browser_sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 } | 779 } |
| 780 | 780 |
| 781 void ProfileSyncService::SetFirstSetupComplete() { | 781 void ProfileSyncService::SetFirstSetupComplete() { |
| 782 DCHECK(thread_checker_.CalledOnValidThread()); | 782 DCHECK(thread_checker_.CalledOnValidThread()); |
| 783 sync_prefs_.SetFirstSetupComplete(); | 783 sync_prefs_.SetFirstSetupComplete(); |
| 784 if (IsEngineInitialized()) { | 784 if (IsEngineInitialized()) { |
| 785 ReconfigureDatatypeManager(); | 785 ReconfigureDatatypeManager(); |
| 786 } | 786 } |
| 787 } | 787 } |
| 788 | 788 |
| 789 bool ProfileSyncService::IsSyncConfirmationNeeded() const { |
| 790 DCHECK(thread_checker_.CalledOnValidThread()); |
| 791 return !IsFirstSetupInProgress() && !IsFirstSetupComplete() && |
| 792 IsSyncRequested(); |
| 793 } |
| 794 |
| 789 void ProfileSyncService::UpdateLastSyncedTime() { | 795 void ProfileSyncService::UpdateLastSyncedTime() { |
| 790 sync_prefs_.SetLastSyncedTime(base::Time::Now()); | 796 sync_prefs_.SetLastSyncedTime(base::Time::Now()); |
| 791 } | 797 } |
| 792 | 798 |
| 793 void ProfileSyncService::NotifySyncCycleCompleted() { | 799 void ProfileSyncService::NotifySyncCycleCompleted() { |
| 794 for (auto& observer : observers_) | 800 for (auto& observer : observers_) |
| 795 observer.OnSyncCycleCompleted(this); | 801 observer.OnSyncCycleCompleted(this); |
| 796 } | 802 } |
| 797 | 803 |
| 798 void ProfileSyncService::NotifyForeignSessionUpdated() { | 804 void ProfileSyncService::NotifyForeignSessionUpdated() { |
| (...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2411 return; | 2417 return; |
| 2412 | 2418 |
| 2413 DCHECK(startup_controller_->IsSetupInProgress()); | 2419 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2414 startup_controller_->SetSetupInProgress(false); | 2420 startup_controller_->SetSetupInProgress(false); |
| 2415 | 2421 |
| 2416 if (IsEngineInitialized()) | 2422 if (IsEngineInitialized()) |
| 2417 ReconfigureDatatypeManager(); | 2423 ReconfigureDatatypeManager(); |
| 2418 NotifyObservers(); | 2424 NotifyObservers(); |
| 2419 } | 2425 } |
| 2420 } // namespace browser_sync | 2426 } // namespace browser_sync |
| OLD | NEW |