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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |