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

Side by Side Diff: chrome/browser/signin/cross_device_promo_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/signin/cross_device_promo_factory.h" 5 #include "chrome/browser/signin/cross_device_promo_factory.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/prefs/pref_service_syncable.h" 8 #include "chrome/browser/prefs/pref_service_syncable.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" 10 #include "chrome/browser/signin/chrome_signin_client_factory.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 // static 32 // static
33 CrossDevicePromo* CrossDevicePromoFactory::GetForProfile(Profile* profile) { 33 CrossDevicePromo* CrossDevicePromoFactory::GetForProfile(Profile* profile) {
34 return static_cast<CrossDevicePromo*>( 34 return static_cast<CrossDevicePromo*>(
35 GetInstance()->GetServiceForBrowserContext(profile, true)); 35 GetInstance()->GetServiceForBrowserContext(profile, true));
36 } 36 }
37 37
38 // static 38 // static
39 CrossDevicePromoFactory* CrossDevicePromoFactory::GetInstance() { 39 CrossDevicePromoFactory* CrossDevicePromoFactory::GetInstance() {
40 return Singleton<CrossDevicePromoFactory>::get(); 40 return base::Singleton<CrossDevicePromoFactory>::get();
41 } 41 }
42 42
43 void CrossDevicePromoFactory::RegisterProfilePrefs( 43 void CrossDevicePromoFactory::RegisterProfilePrefs(
44 user_prefs::PrefRegistrySyncable* user_prefs) { 44 user_prefs::PrefRegistrySyncable* user_prefs) {
45 user_prefs->RegisterBooleanPref(prefs::kCrossDevicePromoOptedOut, false); 45 user_prefs->RegisterBooleanPref(prefs::kCrossDevicePromoOptedOut, false);
46 user_prefs->RegisterBooleanPref(prefs::kCrossDevicePromoShouldBeShown, false); 46 user_prefs->RegisterBooleanPref(prefs::kCrossDevicePromoShouldBeShown, false);
47 user_prefs->RegisterInt64Pref( 47 user_prefs->RegisterInt64Pref(
48 prefs::kCrossDevicePromoObservedSingleAccountCookie, 48 prefs::kCrossDevicePromoObservedSingleAccountCookie,
49 base::Time().ToInternalValue()); 49 base::Time().ToInternalValue());
50 user_prefs->RegisterInt64Pref( 50 user_prefs->RegisterInt64Pref(
51 prefs::kCrossDevicePromoNextFetchListDevicesTime, 51 prefs::kCrossDevicePromoNextFetchListDevicesTime,
52 base::Time().ToInternalValue()); 52 base::Time().ToInternalValue());
53 user_prefs->RegisterIntegerPref(prefs::kCrossDevicePromoNumDevices, 0); 53 user_prefs->RegisterIntegerPref(prefs::kCrossDevicePromoNumDevices, 0);
54 user_prefs->RegisterInt64Pref(prefs::kCrossDevicePromoLastDeviceActiveTime, 54 user_prefs->RegisterInt64Pref(prefs::kCrossDevicePromoLastDeviceActiveTime,
55 base::Time().ToInternalValue()); 55 base::Time().ToInternalValue());
56 } 56 }
57 57
58 KeyedService* CrossDevicePromoFactory::BuildServiceInstanceFor( 58 KeyedService* CrossDevicePromoFactory::BuildServiceInstanceFor(
59 content::BrowserContext* context) const { 59 content::BrowserContext* context) const {
60 Profile* profile = Profile::FromBrowserContext(context); 60 Profile* profile = Profile::FromBrowserContext(context);
61 CrossDevicePromo* service = new CrossDevicePromo( 61 CrossDevicePromo* service = new CrossDevicePromo(
62 SigninManagerFactory::GetForProfile(profile), 62 SigninManagerFactory::GetForProfile(profile),
63 GaiaCookieManagerServiceFactory::GetForProfile(profile), 63 GaiaCookieManagerServiceFactory::GetForProfile(profile),
64 ChromeSigninClientFactory::GetForProfile(profile), profile->GetPrefs()); 64 ChromeSigninClientFactory::GetForProfile(profile), profile->GetPrefs());
65 return service; 65 return service;
66 } 66 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/cross_device_promo_factory.h ('k') | chrome/browser/signin/easy_unlock_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698