Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: chrome/browser/invalidation/profile_invalidation_provider_factory.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 ProfileInvalidationProviderFactory::~ProfileInvalidationProviderFactory() { 87 ProfileInvalidationProviderFactory::~ProfileInvalidationProviderFactory() {
88 } 88 }
89 89
90 void ProfileInvalidationProviderFactory::RegisterTestingFactory( 90 void ProfileInvalidationProviderFactory::RegisterTestingFactory(
91 TestingFactoryFunction testing_factory) { 91 TestingFactoryFunction testing_factory) {
92 testing_factory_ = testing_factory; 92 testing_factory_ = testing_factory;
93 } 93 }
94 94
95 KeyedService* ProfileInvalidationProviderFactory::BuildServiceInstanceFor( 95 KeyedService* ProfileInvalidationProviderFactory::BuildServiceInstanceFor(
sky 2015/06/08 20:18:49 It seems weird not to change this too. Is there a
Ilya Sherman 2015/06/08 22:11:43 I'd like to change it, but would prefer to punt th
96 content::BrowserContext* context) const { 96 content::BrowserContext* context) const {
97 if (testing_factory_) 97 if (testing_factory_)
98 return testing_factory_(context); 98 return testing_factory_(context).release();
99 99
100 #if defined(OS_ANDROID) 100 #if defined(OS_ANDROID)
101 return new ProfileInvalidationProvider(scoped_ptr<InvalidationService>( 101 return new ProfileInvalidationProvider(scoped_ptr<InvalidationService>(
102 new InvalidationServiceAndroid(base::android::GetApplicationContext()))); 102 new InvalidationServiceAndroid(base::android::GetApplicationContext())));
103 #else 103 #else
104 104
105 scoped_ptr<IdentityProvider> identity_provider; 105 scoped_ptr<IdentityProvider> identity_provider;
106 106
107 #if defined(OS_CHROMEOS) 107 #if defined(OS_CHROMEOS)
108 policy::BrowserPolicyConnectorChromeOS* connector = 108 policy::BrowserPolicyConnectorChromeOS* connector =
(...skipping 30 matching lines...) Expand all
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 InvalidatorStorage::RegisterProfilePrefs(registry); 145 InvalidatorStorage::RegisterProfilePrefs(registry);
146 } 146 }
147 147
148 } // namespace invalidation 148 } // namespace invalidation
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698