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/notifications/sync_notifier/chrome_notifier_service_fac
tory.h" | 5 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac
tory.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" | 8 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" |
9 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 9 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
10 | 10 |
11 namespace notifier { | 11 namespace notifier { |
12 | 12 |
13 // static | 13 // static |
14 ChromeNotifierService* ChromeNotifierServiceFactory::GetForProfile( | 14 ChromeNotifierService* ChromeNotifierServiceFactory::GetForProfile( |
15 Profile* profile, Profile::ServiceAccessType sat) { | 15 Profile* profile, Profile::ServiceAccessType sat) { |
16 return static_cast<ChromeNotifierService*>( | 16 return static_cast<ChromeNotifierService*>( |
17 GetInstance()->GetServiceForProfile(profile, true)); | 17 GetInstance()->GetServiceForBrowserContext(profile, true)); |
18 } | 18 } |
19 | 19 |
20 // static | 20 // static |
21 ChromeNotifierServiceFactory* ChromeNotifierServiceFactory::GetInstance() { | 21 ChromeNotifierServiceFactory* ChromeNotifierServiceFactory::GetInstance() { |
22 return Singleton<ChromeNotifierServiceFactory>::get(); | 22 return Singleton<ChromeNotifierServiceFactory>::get(); |
23 } | 23 } |
24 | 24 |
25 ChromeNotifierServiceFactory::ChromeNotifierServiceFactory() | 25 ChromeNotifierServiceFactory::ChromeNotifierServiceFactory() |
26 : ProfileKeyedServiceFactory( | 26 : BrowserContextKeyedServiceFactory( |
27 "ChromeNotifierService", ProfileDependencyManager::GetInstance()) {} | 27 "ChromeNotifierService", |
| 28 BrowserContextDependencyManager::GetInstance()) {} |
28 | 29 |
29 ChromeNotifierServiceFactory::~ChromeNotifierServiceFactory() { | 30 ChromeNotifierServiceFactory::~ChromeNotifierServiceFactory() { |
30 } | 31 } |
31 | 32 |
32 ProfileKeyedService* | 33 BrowserContextKeyedService* |
33 ChromeNotifierServiceFactory::BuildServiceInstanceFor( | 34 ChromeNotifierServiceFactory::BuildServiceInstanceFor( |
34 content::BrowserContext* profile) const { | 35 content::BrowserContext* profile) const { |
35 NotificationUIManager* notification_manager = | 36 NotificationUIManager* notification_manager = |
36 g_browser_process->notification_ui_manager(); | 37 g_browser_process->notification_ui_manager(); |
37 ChromeNotifierService* chrome_notifier_service = | 38 ChromeNotifierService* chrome_notifier_service = |
38 new ChromeNotifierService(static_cast<Profile*>(profile), | 39 new ChromeNotifierService(static_cast<Profile*>(profile), |
39 notification_manager); | 40 notification_manager); |
40 return chrome_notifier_service; | 41 return chrome_notifier_service; |
41 } | 42 } |
42 | 43 |
43 } // namespace notifier | 44 } // namespace notifier |
OLD | NEW |