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

Side by Side Diff: chrome/browser/profiles/gaia_info_update_service_factory.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/profiles/gaia_info_update_service_factory.h" 5 #include "chrome/browser/profiles/gaia_info_update_service_factory.h"
6 6
7 #include "chrome/browser/profiles/gaia_info_update_service.h" 7 #include "chrome/browser/profiles/gaia_info_update_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/signin_manager_factory.h" 9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // static 23 // static
24 GAIAInfoUpdateService* GAIAInfoUpdateServiceFactory::GetForProfile( 24 GAIAInfoUpdateService* GAIAInfoUpdateServiceFactory::GetForProfile(
25 Profile* profile) { 25 Profile* profile) {
26 return static_cast<GAIAInfoUpdateService*>( 26 return static_cast<GAIAInfoUpdateService*>(
27 GetInstance()->GetServiceForBrowserContext(profile, true)); 27 GetInstance()->GetServiceForBrowserContext(profile, true));
28 } 28 }
29 29
30 // static 30 // static
31 GAIAInfoUpdateServiceFactory* GAIAInfoUpdateServiceFactory::GetInstance() { 31 GAIAInfoUpdateServiceFactory* GAIAInfoUpdateServiceFactory::GetInstance() {
32 return Singleton<GAIAInfoUpdateServiceFactory>::get(); 32 return base::Singleton<GAIAInfoUpdateServiceFactory>::get();
33 } 33 }
34 34
35 KeyedService* GAIAInfoUpdateServiceFactory::BuildServiceInstanceFor( 35 KeyedService* GAIAInfoUpdateServiceFactory::BuildServiceInstanceFor(
36 content::BrowserContext* context) const { 36 content::BrowserContext* context) const {
37 Profile* profile = static_cast<Profile*>(context); 37 Profile* profile = static_cast<Profile*>(context);
38 if (!GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(profile)) 38 if (!GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(profile))
39 return NULL; 39 return NULL;
40 return new GAIAInfoUpdateService(profile); 40 return new GAIAInfoUpdateService(profile);
41 } 41 }
42 42
43 void GAIAInfoUpdateServiceFactory::RegisterProfilePrefs( 43 void GAIAInfoUpdateServiceFactory::RegisterProfilePrefs(
44 user_prefs::PrefRegistrySyncable* prefs) { 44 user_prefs::PrefRegistrySyncable* prefs) {
45 prefs->RegisterInt64Pref(prefs::kProfileGAIAInfoUpdateTime, 0); 45 prefs->RegisterInt64Pref(prefs::kProfileGAIAInfoUpdateTime, 0);
46 prefs->RegisterStringPref(prefs::kProfileGAIAInfoPictureURL, std::string()); 46 prefs->RegisterStringPref(prefs::kProfileGAIAInfoPictureURL, std::string());
47 } 47 }
48 48
49 bool GAIAInfoUpdateServiceFactory::ServiceIsNULLWhileTesting() const { 49 bool GAIAInfoUpdateServiceFactory::ServiceIsNULLWhileTesting() const {
50 return true; 50 return true;
51 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698