| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/sync/glue/session_model_associator.h" | 5 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)), | 96 ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)), |
| 97 profile_(sync_service->profile()), | 97 profile_(sync_service->profile()), |
| 98 pref_service_(profile_->GetPrefs()), | 98 pref_service_(profile_->GetPrefs()), |
| 99 error_handler_(error_handler) { | 99 error_handler_(error_handler) { |
| 100 DCHECK(CalledOnValidThread()); | 100 DCHECK(CalledOnValidThread()); |
| 101 DCHECK(sync_service_); | 101 DCHECK(sync_service_); |
| 102 DCHECK(profile_); | 102 DCHECK(profile_); |
| 103 if (pref_service_->FindPreference(kSyncSessionsGUID) == NULL) { | 103 if (pref_service_->FindPreference(kSyncSessionsGUID) == NULL) { |
| 104 pref_service_->RegisterStringPref(kSyncSessionsGUID, | 104 pref_service_->RegisterStringPref(kSyncSessionsGUID, |
| 105 std::string(), | 105 std::string(), |
| 106 PrefService::UNSYNCABLE_PREF); | 106 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service, | 110 SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service, |
| 111 bool setup_for_test) | 111 bool setup_for_test) |
| 112 : tab_pool_(sync_service), | 112 : tab_pool_(sync_service), |
| 113 local_session_syncid_(syncer::kInvalidId), | 113 local_session_syncid_(syncer::kInvalidId), |
| 114 sync_service_(sync_service), | 114 sync_service_(sync_service), |
| 115 stale_session_threshold_days_(kDefaultStaleSessionThresholdDays), | 115 stale_session_threshold_days_(kDefaultStaleSessionThresholdDays), |
| 116 setup_for_test_(setup_for_test), | 116 setup_for_test_(setup_for_test), |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 | 1242 |
| 1243 bool SessionModelAssociator::CryptoReadyIfNecessary() { | 1243 bool SessionModelAssociator::CryptoReadyIfNecessary() { |
| 1244 // We only access the cryptographer while holding a transaction. | 1244 // We only access the cryptographer while holding a transaction. |
| 1245 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 1245 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
| 1246 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); | 1246 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); |
| 1247 return !encrypted_types.Has(SESSIONS) || | 1247 return !encrypted_types.Has(SESSIONS) || |
| 1248 sync_service_->IsCryptographerReady(&trans); | 1248 sync_service_->IsCryptographerReady(&trans); |
| 1249 } | 1249 } |
| 1250 | 1250 |
| 1251 } // namespace browser_sync | 1251 } // namespace browser_sync |
| OLD | NEW |