• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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/synced_notification_app_info_service_factory.h"
6 
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/notifications/sync_notifier/synced_notification_app_info_service.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 
11 namespace notifier {
12 
13 // static
14 SyncedNotificationAppInfoService*
GetForProfile(Profile * profile,Profile::ServiceAccessType service_access_type)15 SyncedNotificationAppInfoServiceFactory::GetForProfile(
16     Profile* profile,
17     Profile::ServiceAccessType service_access_type) {
18   return static_cast<SyncedNotificationAppInfoService*>(
19       GetInstance()->GetServiceForBrowserContext(profile, true));
20 }
21 
22 // static
23 SyncedNotificationAppInfoServiceFactory*
GetInstance()24 SyncedNotificationAppInfoServiceFactory::GetInstance() {
25   return Singleton<SyncedNotificationAppInfoServiceFactory>::get();
26 }
27 
28 SyncedNotificationAppInfoServiceFactory::
SyncedNotificationAppInfoServiceFactory()29     SyncedNotificationAppInfoServiceFactory()
30     : BrowserContextKeyedServiceFactory(
31           "SyncedNotificationAppInfoService",
32           BrowserContextDependencyManager::GetInstance()) {}
33 
34 SyncedNotificationAppInfoServiceFactory::
~SyncedNotificationAppInfoServiceFactory()35     ~SyncedNotificationAppInfoServiceFactory() {}
36 
BuildServiceInstanceFor(content::BrowserContext * profile) const37 KeyedService* SyncedNotificationAppInfoServiceFactory::BuildServiceInstanceFor(
38     content::BrowserContext* profile) const {
39   SyncedNotificationAppInfoService* app_info_service =
40       new SyncedNotificationAppInfoService(static_cast<Profile*>(profile));
41   return app_info_service;
42 }
43 
44 }  // namespace notifier
45