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

Side by Side Diff: chrome/browser/services/gcm/gcm_profile_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) 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/services/gcm/gcm_profile_service_factory.h" 5 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/profiles/incognito_helpers.h" 8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/services/gcm/gcm_profile_service.h" 10 #include "chrome/browser/services/gcm/gcm_profile_service.h"
(...skipping 14 matching lines...) Expand all
25 // GCM is not supported in incognito mode. 25 // GCM is not supported in incognito mode.
26 if (profile->IsOffTheRecord()) 26 if (profile->IsOffTheRecord())
27 return NULL; 27 return NULL;
28 28
29 return static_cast<GCMProfileService*>( 29 return static_cast<GCMProfileService*>(
30 GetInstance()->GetServiceForBrowserContext(profile, true)); 30 GetInstance()->GetServiceForBrowserContext(profile, true));
31 } 31 }
32 32
33 // static 33 // static
34 GCMProfileServiceFactory* GCMProfileServiceFactory::GetInstance() { 34 GCMProfileServiceFactory* GCMProfileServiceFactory::GetInstance() {
35 return Singleton<GCMProfileServiceFactory>::get(); 35 return base::Singleton<GCMProfileServiceFactory>::get();
36 } 36 }
37 37
38 GCMProfileServiceFactory::GCMProfileServiceFactory() 38 GCMProfileServiceFactory::GCMProfileServiceFactory()
39 : BrowserContextKeyedServiceFactory( 39 : BrowserContextKeyedServiceFactory(
40 "GCMProfileService", 40 "GCMProfileService",
41 BrowserContextDependencyManager::GetInstance()) { 41 BrowserContextDependencyManager::GetInstance()) {
42 DependsOn(SigninManagerFactory::GetInstance()); 42 DependsOn(SigninManagerFactory::GetInstance());
43 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); 43 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
44 #if !defined(OS_ANDROID) 44 #if !defined(OS_ANDROID)
45 DependsOn(LoginUIServiceFactory::GetInstance()); 45 DependsOn(LoginUIServiceFactory::GetInstance());
(...skipping 13 matching lines...) Expand all
59 scoped_ptr<GCMClientFactory>(new GCMClientFactory)); 59 scoped_ptr<GCMClientFactory>(new GCMClientFactory));
60 #endif 60 #endif
61 } 61 }
62 62
63 content::BrowserContext* GCMProfileServiceFactory::GetBrowserContextToUse( 63 content::BrowserContext* GCMProfileServiceFactory::GetBrowserContextToUse(
64 content::BrowserContext* context) const { 64 content::BrowserContext* context) const {
65 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 65 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
66 } 66 }
67 67
68 } // namespace gcm 68 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698