OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/invalidation/profile_invalidation_provider_factory.h" | 5 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/prefs/pref_registry.h" | 8 #include "base/prefs/pref_registry.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/invalidation/ticl_profile_settings_provider.h" | 10 #include "chrome/browser/invalidation/ticl_profile_settings_provider.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 scoped_ptr<TiclInvalidationService> service(new TiclInvalidationService( | 126 scoped_ptr<TiclInvalidationService> service(new TiclInvalidationService( |
127 GetUserAgent(), | 127 GetUserAgent(), |
128 identity_provider.Pass(), | 128 identity_provider.Pass(), |
129 scoped_ptr<TiclSettingsProvider>( | 129 scoped_ptr<TiclSettingsProvider>( |
130 new TiclProfileSettingsProvider(profile)), | 130 new TiclProfileSettingsProvider(profile)), |
131 gcm::GCMProfileServiceFactory::GetForProfile(profile)->driver(), | 131 gcm::GCMProfileServiceFactory::GetForProfile(profile)->driver(), |
132 profile->GetRequestContext())); | 132 profile->GetRequestContext())); |
133 service->Init(scoped_ptr<syncer::InvalidationStateTracker>( | 133 service->Init(scoped_ptr<syncer::InvalidationStateTracker>( |
134 new InvalidatorStorage(profile->GetPrefs()))); | 134 new InvalidatorStorage(profile->GetPrefs()))); |
135 | 135 |
136 return new ProfileInvalidationProvider(service.PassAs<InvalidationService>()); | 136 return new ProfileInvalidationProvider(service.Pass()); |
137 #endif | 137 #endif |
138 } | 138 } |
139 | 139 |
140 void ProfileInvalidationProviderFactory::RegisterProfilePrefs( | 140 void ProfileInvalidationProviderFactory::RegisterProfilePrefs( |
141 user_prefs::PrefRegistrySyncable* registry) { | 141 user_prefs::PrefRegistrySyncable* registry) { |
142 registry->RegisterBooleanPref( | 142 registry->RegisterBooleanPref( |
143 prefs::kInvalidationServiceUseGCMChannel, | 143 prefs::kInvalidationServiceUseGCMChannel, |
144 true, // if no value in prefs, use GCM channel. | 144 true, // if no value in prefs, use GCM channel. |
145 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 145 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
146 InvalidatorStorage::RegisterProfilePrefs(registry); | 146 InvalidatorStorage::RegisterProfilePrefs(registry); |
147 } | 147 } |
148 | 148 |
149 } // namespace invalidation | 149 } // namespace invalidation |
OLD | NEW |