OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/extensions/api/push_messaging/push_messaging_api_factor
y.h" | |
6 | |
7 #include "chrome/browser/extensions/api/push_messaging/push_messaging_api.h" | |
8 #include "chrome/browser/extensions/extension_system_factory.h" | |
9 #include "chrome/browser/profiles/profile_dependency_manager.h" | |
10 #include "chrome/browser/sync/profile_sync_service_factory.h" | |
11 | |
12 namespace extensions { | |
13 | |
14 // static | |
15 PushMessagingAPI* PushMessagingAPIFactory::GetForProfile( | |
16 Profile* profile) { | |
17 return static_cast<PushMessagingAPI*>( | |
18 GetInstance()->GetServiceForProfile(profile, true)); | |
19 } | |
20 | |
21 // static | |
22 PushMessagingAPIFactory* PushMessagingAPIFactory::GetInstance() { | |
23 return Singleton<PushMessagingAPIFactory>::get(); | |
24 } | |
25 | |
26 PushMessagingAPIFactory::PushMessagingAPIFactory() | |
27 : ProfileKeyedServiceFactory("PushMessagingAPI", | |
28 ProfileDependencyManager::GetInstance()) { | |
29 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); | |
30 DependsOn(ProfileSyncServiceFactory::GetInstance()); | |
31 } | |
32 | |
33 PushMessagingAPIFactory::~PushMessagingAPIFactory() { | |
34 } | |
35 | |
36 ProfileKeyedService* PushMessagingAPIFactory::BuildServiceInstanceFor( | |
37 Profile* profile) const { | |
38 return new PushMessagingAPI(profile); | |
39 } | |
40 | |
41 bool PushMessagingAPIFactory::ServiceIsNULLWhileTesting() const { | |
42 return true; | |
43 } | |
44 | |
45 } // namespace extensions | |
OLD | NEW |