Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: sync/internal_api/sync_manager_impl.cc

Issue 10805002: [Sync] Enable adding notifier observers from ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "sync/internal_api/sync_manager_impl.h" 5 #include "sync/internal_api/sync_manager_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 if (!connection_manager_->set_auth_token(credentials.sync_token)) 726 if (!connection_manager_->set_auth_token(credentials.sync_token))
727 return; // Auth token is known to be invalid, so exit early. 727 return; // Auth token is known to be invalid, so exit early.
728 728
729 sync_notifier_->UpdateCredentials(credentials.email, credentials.sync_token); 729 sync_notifier_->UpdateCredentials(credentials.email, credentials.sync_token);
730 scheduler_->OnCredentialsUpdated(); 730 scheduler_->OnCredentialsUpdated();
731 } 731 }
732 732
733 void SyncManagerImpl::UpdateEnabledTypes( 733 void SyncManagerImpl::UpdateEnabledTypes(
734 const ModelTypeSet& enabled_types) { 734 const ModelTypeSet& enabled_types) {
735 DCHECK(thread_checker_.CalledOnValidThread()); 735 DCHECK(thread_checker_.CalledOnValidThread());
736 sync_notifier_->UpdateRegisteredIds(this, 736 sync_notifier_->UpdateRegisteredIds(
737 ModelTypeSetToObjectIdSet(enabled_types)); 737 this,
738 ModelTypeSetToObjectIdSet(enabled_types));
739 }
740
741 void SyncManagerImpl::UpdateRegisteredInvalidationIds(
742 SyncNotifierObserver* handler, const ObjectIdSet& ids) {
743 DCHECK(thread_checker_.CalledOnValidThread());
744 sync_notifier_->UpdateRegisteredIds(handler, ids);
738 } 745 }
739 746
740 void SyncManagerImpl::SetEncryptionPassphrase( 747 void SyncManagerImpl::SetEncryptionPassphrase(
741 const std::string& passphrase, 748 const std::string& passphrase,
742 bool is_explicit) { 749 bool is_explicit) {
743 DCHECK(thread_checker_.CalledOnValidThread()); 750 DCHECK(thread_checker_.CalledOnValidThread());
744 // We do not accept empty passphrases. 751 // We do not accept empty passphrases.
745 if (passphrase.empty()) { 752 if (passphrase.empty()) {
746 NOTREACHED() << "Cannot encrypt with an empty passphrase."; 753 NOTREACHED() << "Cannot encrypt with an empty passphrase.";
747 return; 754 return;
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 int SyncManagerImpl::GetDefaultNudgeDelay() { 1886 int SyncManagerImpl::GetDefaultNudgeDelay() {
1880 return kDefaultNudgeDelayMilliseconds; 1887 return kDefaultNudgeDelayMilliseconds;
1881 } 1888 }
1882 1889
1883 // static. 1890 // static.
1884 int SyncManagerImpl::GetPreferencesNudgeDelay() { 1891 int SyncManagerImpl::GetPreferencesNudgeDelay() {
1885 return kPreferencesNudgeDelayMilliseconds; 1892 return kPreferencesNudgeDelayMilliseconds;
1886 } 1893 }
1887 1894
1888 } // namespace syncer 1895 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698