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

Unified Diff: chrome/browser/notifications/notification_display_service_factory.cc

Issue 1814923002: Nuke NotificationUIManager from PlatformNotificationServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@profile_manager_load
Patch Set: Rebase Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/notification_display_service_factory.cc
diff --git a/chrome/browser/notifications/notification_display_service_factory.cc b/chrome/browser/notifications/notification_display_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..437f0897c1b140957775ae0f0b844be3e9df30a3
--- /dev/null
+++ b/chrome/browser/notifications/notification_display_service_factory.cc
@@ -0,0 +1,26 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/memory/singleton.h"
+#include "chrome/browser/notifications/notification_display_service_factory.h"
+#include "chrome/browser/profiles/profile.h"
+
+// static
+NotificationDisplayService* NotificationDisplayServiceFactory::GetForProfile(
+ Profile* profile) {
+ return static_cast<NotificationDisplayService*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+NotificationDisplayServiceFactory*
+NotificationDisplayServiceFactory::GetInstance() {
+ return base::Singleton<NotificationDisplayServiceFactory>::get();
+}
+
+KeyedService* NotificationDisplayServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return NotificationDisplayService::Create(
+ Profile::FromBrowserContext(context));
+}

Powered by Google App Engine
This is Rietveld 408576698