| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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/notifications/extension_notification_dis
play_helper_factory.h" |
| 6 |
| 7 #include "chrome/browser/extensions/api/notifications/extension_notification_dis
play_helper.h" |
| 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 10 |
| 11 namespace extensions { |
| 12 |
| 13 // static |
| 14 ExtensionNotificationDisplayHelperFactory* |
| 15 ExtensionNotificationDisplayHelperFactory::GetInstance() { |
| 16 return base::Singleton<ExtensionNotificationDisplayHelperFactory>::get(); |
| 17 } |
| 18 |
| 19 // static |
| 20 ExtensionNotificationDisplayHelper* |
| 21 ExtensionNotificationDisplayHelperFactory::GetForProfile(Profile* profile) { |
| 22 return static_cast<ExtensionNotificationDisplayHelper*>( |
| 23 GetInstance()->GetServiceForBrowserContext(profile, true /* create */)); |
| 24 } |
| 25 |
| 26 KeyedService* |
| 27 ExtensionNotificationDisplayHelperFactory::BuildServiceInstanceFor( |
| 28 content::BrowserContext* context) const { |
| 29 Profile* profile = Profile::FromBrowserContext(context); |
| 30 return new ExtensionNotificationDisplayHelper(profile); |
| 31 } |
| 32 |
| 33 ExtensionNotificationDisplayHelperFactory:: |
| 34 ExtensionNotificationDisplayHelperFactory() |
| 35 : BrowserContextKeyedServiceFactory( |
| 36 "ExtensionNotificationDisplayHelperFactory", |
| 37 BrowserContextDependencyManager::GetInstance()) {} |
| 38 |
| 39 ExtensionNotificationDisplayHelperFactory:: |
| 40 ~ExtensionNotificationDisplayHelperFactory() {} |
| 41 |
| 42 } // namespace extensions |
| OLD | NEW |