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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 { | 789 bool ProfileSyncService::IsSyncConfirmationNeeded() const { |
790 DCHECK(thread_checker_.CalledOnValidThread()); | 790 DCHECK(thread_checker_.CalledOnValidThread()); |
791 return !IsFirstSetupInProgress() && !IsFirstSetupComplete() && | 791 return IsSignedIn() && !IsFirstSetupInProgress() && !IsFirstSetupComplete() && |
792 IsSyncRequested(); | 792 IsSyncRequested(); |
skym
2017/06/14 17:22:18
"IsSyncRequested()" is a confusing name. It seems
| |
793 } | 793 } |
794 | 794 |
795 void ProfileSyncService::UpdateLastSyncedTime() { | 795 void ProfileSyncService::UpdateLastSyncedTime() { |
796 sync_prefs_.SetLastSyncedTime(base::Time::Now()); | 796 sync_prefs_.SetLastSyncedTime(base::Time::Now()); |
797 } | 797 } |
798 | 798 |
799 void ProfileSyncService::NotifySyncCycleCompleted() { | 799 void ProfileSyncService::NotifySyncCycleCompleted() { |
800 for (auto& observer : observers_) | 800 for (auto& observer : observers_) |
801 observer.OnSyncCycleCompleted(this); | 801 observer.OnSyncCycleCompleted(this); |
802 } | 802 } |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2417 return; | 2417 return; |
2418 | 2418 |
2419 DCHECK(startup_controller_->IsSetupInProgress()); | 2419 DCHECK(startup_controller_->IsSetupInProgress()); |
2420 startup_controller_->SetSetupInProgress(false); | 2420 startup_controller_->SetSetupInProgress(false); |
2421 | 2421 |
2422 if (IsEngineInitialized()) | 2422 if (IsEngineInitialized()) |
2423 ReconfigureDatatypeManager(); | 2423 ReconfigureDatatypeManager(); |
2424 NotifyObservers(); | 2424 NotifyObservers(); |
2425 } | 2425 } |
2426 } // namespace browser_sync | 2426 } // namespace browser_sync |
OLD | NEW |