| 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_->SetAuthToken(credentials.sync_token, | 601 if (!connection_manager_->SetAuthToken(credentials.sync_token)) |
| 602 credentials.sync_token_time)) | |
| 603 return; // Auth token is known to be invalid, so exit early. | 602 return; // Auth token is known to be invalid, so exit early. |
| 604 | 603 |
| 605 invalidator_->UpdateCredentials(credentials.email, credentials.sync_token); | 604 invalidator_->UpdateCredentials(credentials.email, credentials.sync_token); |
| 606 scheduler_->OnCredentialsUpdated(); | 605 scheduler_->OnCredentialsUpdated(); |
| 607 | 606 |
| 608 // TODO(zea): pass the credential age to the debug info event listener. | 607 // TODO(zea): pass the credential age to the debug info event listener. |
| 609 } | 608 } |
| 610 | 609 |
| 611 void SyncManagerImpl::UpdateEnabledTypes(ModelTypeSet enabled_types) { | 610 void SyncManagerImpl::UpdateEnabledTypes(ModelTypeSet enabled_types) { |
| 612 DCHECK(thread_checker_.CalledOnValidThread()); | 611 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1389 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1391 return kDefaultNudgeDelayMilliseconds; | 1390 return kDefaultNudgeDelayMilliseconds; |
| 1392 } | 1391 } |
| 1393 | 1392 |
| 1394 // static. | 1393 // static. |
| 1395 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1394 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1396 return kPreferencesNudgeDelayMilliseconds; | 1395 return kPreferencesNudgeDelayMilliseconds; |
| 1397 } | 1396 } |
| 1398 | 1397 |
| 1399 } // namespace syncer | 1398 } // namespace syncer |
| OLD | NEW |