| 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 "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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 return directory()->PurgeEntriesWithTypeIn(disabled_types, failed_types); | 591 return directory()->PurgeEntriesWithTypeIn(disabled_types, failed_types); |
| 592 } | 592 } |
| 593 | 593 |
| 594 void SyncManagerImpl::UpdateCredentials(const SyncCredentials& credentials) { | 594 void SyncManagerImpl::UpdateCredentials(const SyncCredentials& credentials) { |
| 595 DCHECK(thread_checker_.CalledOnValidThread()); | 595 DCHECK(thread_checker_.CalledOnValidThread()); |
| 596 DCHECK(initialized_); | 596 DCHECK(initialized_); |
| 597 DCHECK(!credentials.email.empty()); | 597 DCHECK(!credentials.email.empty()); |
| 598 DCHECK(!credentials.sync_token.empty()); | 598 DCHECK(!credentials.sync_token.empty()); |
| 599 | 599 |
| 600 observing_network_connectivity_changes_ = true; | 600 observing_network_connectivity_changes_ = true; |
| 601 if (!connection_manager_->set_auth_token(credentials.sync_token)) | 601 if (!connection_manager_->set_auth_token(credentials.sync_token, |
| 602 credentials.sync_token_time)) |
| 602 return; // Auth token is known to be invalid, so exit early. | 603 return; // Auth token is known to be invalid, so exit early. |
| 603 | 604 |
| 604 invalidator_->UpdateCredentials(credentials.email, credentials.sync_token); | 605 invalidator_->UpdateCredentials(credentials.email, credentials.sync_token); |
| 605 scheduler_->OnCredentialsUpdated(); | 606 scheduler_->OnCredentialsUpdated(); |
| 607 |
| 608 // TODO(zea): pass the credential age to the debug info event listener. |
| 606 } | 609 } |
| 607 | 610 |
| 608 void SyncManagerImpl::UpdateEnabledTypes(ModelTypeSet enabled_types) { | 611 void SyncManagerImpl::UpdateEnabledTypes(ModelTypeSet enabled_types) { |
| 609 DCHECK(thread_checker_.CalledOnValidThread()); | 612 DCHECK(thread_checker_.CalledOnValidThread()); |
| 610 DCHECK(initialized_); | 613 DCHECK(initialized_); |
| 611 invalidator_->UpdateRegisteredIds( | 614 invalidator_->UpdateRegisteredIds( |
| 612 this, | 615 this, |
| 613 ModelTypeSetToObjectIdSet(enabled_types)); | 616 ModelTypeSetToObjectIdSet(enabled_types)); |
| 614 } | 617 } |
| 615 | 618 |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1397 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1395 return kDefaultNudgeDelayMilliseconds; | 1398 return kDefaultNudgeDelayMilliseconds; |
| 1396 } | 1399 } |
| 1397 | 1400 |
| 1398 // static. | 1401 // static. |
| 1399 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1402 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1400 return kPreferencesNudgeDelayMilliseconds; | 1403 return kPreferencesNudgeDelayMilliseconds; |
| 1401 } | 1404 } |
| 1402 | 1405 |
| 1403 } // namespace syncer | 1406 } // namespace syncer |
| OLD | NEW |