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