Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.cc

Issue 2703213004: Migrate extension notifications to the new NotificationDisplayService (Closed)
Patch Set: another rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/incognito_helpers.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11
12 namespace extensions {
13
14 // static
15 ExtensionNotificationDisplayHelperFactory*
16 ExtensionNotificationDisplayHelperFactory::GetInstance() {
17 return base::Singleton<ExtensionNotificationDisplayHelperFactory>::get();
18 }
19
20 // static
21 ExtensionNotificationDisplayHelper*
22 ExtensionNotificationDisplayHelperFactory::GetForProfile(Profile* profile) {
23 return static_cast<ExtensionNotificationDisplayHelper*>(
24 GetInstance()->GetServiceForBrowserContext(profile, true /* create */));
25 }
26
27 ExtensionNotificationDisplayHelperFactory::
28 ExtensionNotificationDisplayHelperFactory()
29 : BrowserContextKeyedServiceFactory(
30 "ExtensionNotificationDisplayHelperFactory",
31 BrowserContextDependencyManager::GetInstance()) {}
32
33 ExtensionNotificationDisplayHelperFactory::
34 ~ExtensionNotificationDisplayHelperFactory() {}
35
36 KeyedService*
37 ExtensionNotificationDisplayHelperFactory::BuildServiceInstanceFor(
38 content::BrowserContext* context) const {
39 Profile* profile = Profile::FromBrowserContext(context);
40 return new ExtensionNotificationDisplayHelper(profile);
41 }
42
43 content::BrowserContext*
44 ExtensionNotificationDisplayHelperFactory::GetBrowserContextToUse(
45 content::BrowserContext* context) const {
46 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
47 }
Devlin 2017/04/10 21:23:55 \n
Peter Beverloo 2017/04/11 14:19:25 Done.
48 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698