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

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: Miguel's comments Created 3 years, 10 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/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 */));
dewittj 2017/03/01 17:59:08 this returns nullptr for incognito,is that what yo
Peter Beverloo 2017/04/05 23:22:12 That's a fantastic point - no, that's not that I w
Peter Beverloo 2017/04/07 17:33:29 Done.
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698