OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/engine/syncapi.h" | 5 #include "chrome/browser/sync/engine/syncapi.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <bitset> | 8 #include <bitset> |
9 #include <iomanip> | 9 #include <iomanip> |
10 #include <list> | 10 #include <list> |
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 } | 1938 } |
1939 | 1939 |
1940 void SyncManager::SyncInternal::UpdateCredentials( | 1940 void SyncManager::SyncInternal::UpdateCredentials( |
1941 const SyncCredentials& credentials) { | 1941 const SyncCredentials& credentials) { |
1942 DCHECK(thread_checker_.CalledOnValidThread()); | 1942 DCHECK(thread_checker_.CalledOnValidThread()); |
1943 DCHECK_EQ(credentials.email, share_.name); | 1943 DCHECK_EQ(credentials.email, share_.name); |
1944 DCHECK(!credentials.email.empty()); | 1944 DCHECK(!credentials.email.empty()); |
1945 DCHECK(!credentials.sync_token.empty()); | 1945 DCHECK(!credentials.sync_token.empty()); |
1946 | 1946 |
1947 observing_ip_address_changes_ = true; | 1947 observing_ip_address_changes_ = true; |
1948 connection_manager()->set_auth_token(credentials.sync_token); | 1948 if (connection_manager()->set_auth_token(credentials.sync_token)) { |
1949 sync_notifier_->UpdateCredentials( | 1949 sync_notifier_->UpdateCredentials( |
1950 credentials.email, credentials.sync_token); | 1950 credentials.email, credentials.sync_token); |
1951 if (!setup_for_test_mode_) { | 1951 if (!setup_for_test_mode_) { |
1952 CheckServerReachable(); | 1952 CheckServerReachable(); |
| 1953 } |
1953 } | 1954 } |
1954 } | 1955 } |
1955 | 1956 |
1956 void SyncManager::SyncInternal::UpdateEnabledTypes() { | 1957 void SyncManager::SyncInternal::UpdateEnabledTypes() { |
1957 DCHECK(thread_checker_.CalledOnValidThread()); | 1958 DCHECK(thread_checker_.CalledOnValidThread()); |
1958 ModelSafeRoutingInfo routes; | 1959 ModelSafeRoutingInfo routes; |
1959 registrar_->GetModelSafeRoutingInfo(&routes); | 1960 registrar_->GetModelSafeRoutingInfo(&routes); |
1960 syncable::ModelTypeSet enabled_types; | 1961 syncable::ModelTypeSet enabled_types; |
1961 for (ModelSafeRoutingInfo::const_iterator it = routes.begin(); | 1962 for (ModelSafeRoutingInfo::const_iterator it = routes.begin(); |
1962 it != routes.end(); ++it) { | 1963 it != routes.end(); ++it) { |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3010 void SyncManager::TriggerOnIncomingNotificationForTest( | 3011 void SyncManager::TriggerOnIncomingNotificationForTest( |
3011 const syncable::ModelTypeBitSet& model_types) { | 3012 const syncable::ModelTypeBitSet& model_types) { |
3012 syncable::ModelTypePayloadMap model_types_with_payloads = | 3013 syncable::ModelTypePayloadMap model_types_with_payloads = |
3013 syncable::ModelTypePayloadMapFromBitSet(model_types, | 3014 syncable::ModelTypePayloadMapFromBitSet(model_types, |
3014 std::string()); | 3015 std::string()); |
3015 | 3016 |
3016 data_->OnIncomingNotification(model_types_with_payloads); | 3017 data_->OnIncomingNotification(model_types_with_payloads); |
3017 } | 3018 } |
3018 | 3019 |
3019 } // namespace sync_api | 3020 } // namespace sync_api |
OLD | NEW |