OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/notifier/chrome_notifier_service_factory.h" |
| 6 |
| 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/notifier/chrome_notifier_service.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 11 |
| 12 namespace notifier { |
| 13 |
| 14 // static |
| 15 ChromeNotifierService* ChromeNotifierServiceFactory::GetForProfile( |
| 16 Profile* profile, Profile::ServiceAccessType sat) { |
| 17 return static_cast<ChromeNotifierService*>( |
| 18 GetInstance()->GetServiceForProfile(profile, true)); |
| 19 } |
| 20 |
| 21 // static |
| 22 ChromeNotifierServiceFactory* ChromeNotifierServiceFactory::GetInstance() { |
| 23 return Singleton<ChromeNotifierServiceFactory>::get(); |
| 24 } |
| 25 |
| 26 ChromeNotifierServiceFactory::ChromeNotifierServiceFactory() |
| 27 : ProfileKeyedServiceFactory( |
| 28 "ChromeNotifierService", ProfileDependencyManager::GetInstance()) {} |
| 29 |
| 30 ChromeNotifierServiceFactory::~ChromeNotifierServiceFactory() { |
| 31 } |
| 32 |
| 33 ProfileKeyedService* |
| 34 ChromeNotifierServiceFactory::BuildServiceInstanceFor(Profile* profile) const { |
| 35 NotificationUIManager* notification_manager = |
| 36 g_browser_process->notification_ui_manager(); |
| 37 ChromeNotifierService* chrome_notifier_service = |
| 38 new ChromeNotifierService(profile, notification_manager); |
| 39 return chrome_notifier_service; |
| 40 } |
| 41 |
| 42 bool ChromeNotifierServiceFactory::ServiceRedirectedInIncognito() const { |
| 43 return true; |
| 44 } |
| 45 |
| 46 bool ChromeNotifierServiceFactory::ServiceIsNULLWhileTesting() const { |
| 47 return true; |
| 48 } |
| 49 |
| 50 bool ChromeNotifierServiceFactory::ServiceIsCreatedWithProfile() const { |
| 51 return true; |
| 52 } |
| 53 |
| 54 } // namespace notifier |
OLD | NEW |