| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/invalidation_service_factory.h" | 5 #include "chrome/browser/invalidation/invalidation_service_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/fake_invalidation_service.h" | 10 #include "chrome/browser/invalidation/fake_invalidation_service.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 identity_provider.reset(new ProfileIdentityProvider( | 118 identity_provider.reset(new ProfileIdentityProvider( |
| 119 SigninManagerFactory::GetForProfile(profile), | 119 SigninManagerFactory::GetForProfile(profile), |
| 120 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 120 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
| 121 LoginUIServiceFactory::GetForProfile(profile))); | 121 LoginUIServiceFactory::GetForProfile(profile))); |
| 122 } | 122 } |
| 123 | 123 |
| 124 TiclInvalidationService* service = new TiclInvalidationService( | 124 TiclInvalidationService* service = new TiclInvalidationService( |
| 125 identity_provider.Pass(), | 125 identity_provider.Pass(), |
| 126 scoped_ptr<TiclSettingsProvider>( | 126 scoped_ptr<TiclSettingsProvider>( |
| 127 new TiclProfileSettingsProvider(profile)), | 127 new TiclProfileSettingsProvider(profile)), |
| 128 gcm::GCMProfileServiceFactory::GetForProfile(profile), | 128 gcm::GCMProfileServiceFactory::GetForProfile(profile)->driver(), |
| 129 profile->GetRequestContext()); | 129 profile->GetRequestContext()); |
| 130 service->Init(scoped_ptr<syncer::InvalidationStateTracker>( | 130 service->Init(scoped_ptr<syncer::InvalidationStateTracker>( |
| 131 new InvalidatorStorage(profile->GetPrefs()))); | 131 new InvalidatorStorage(profile->GetPrefs()))); |
| 132 return service; | 132 return service; |
| 133 #endif | 133 #endif |
| 134 } | 134 } |
| 135 | 135 |
| 136 void InvalidationServiceFactory::RegisterProfilePrefs( | 136 void InvalidationServiceFactory::RegisterProfilePrefs( |
| 137 user_prefs::PrefRegistrySyncable* registry) { | 137 user_prefs::PrefRegistrySyncable* registry) { |
| 138 registry->RegisterBooleanPref( | 138 registry->RegisterBooleanPref( |
| 139 prefs::kInvalidationServiceUseGCMChannel, | 139 prefs::kInvalidationServiceUseGCMChannel, |
| 140 false, | 140 false, |
| 141 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 141 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 142 InvalidatorStorage::RegisterProfilePrefs(registry); | 142 InvalidatorStorage::RegisterProfilePrefs(registry); |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace invalidation | 145 } // namespace invalidation |
| OLD | NEW |