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

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

Issue 1814923002: Nuke NotificationUIManager from PlatformNotificationServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@profile_manager_load
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/chrome_notification_display_service.cc
diff --git a/chrome/browser/notifications/chrome_notification_display_service.cc b/chrome/browser/notifications/chrome_notification_display_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4bea0e7bc7926ceb1f3d5562821d267f050d7cb7
--- /dev/null
+++ b/chrome/browser/notifications/chrome_notification_display_service.cc
@@ -0,0 +1,42 @@
+// 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 "chrome/browser/notifications/chrome_notification_display_service.h"
+
+#include "chrome/browser/notifications/notification.h"
+#include "chrome/browser/notifications/notification_ui_manager.h"
+#include "chrome/browser/profiles/profile.h"
+
+ChromeNotificationDisplayService::ChromeNotificationDisplayService(
+ Profile* profile,
+ NotificationUIManager* ui_manager)
+ : profile_(profile), ui_manager_(ui_manager) {}
+
+ChromeNotificationDisplayService::~ChromeNotificationDisplayService() {}
+
+void ChromeNotificationDisplayService::Display(
+ const std::string& notification_id,
+ const Notification& notification) {
+ ui_manager_->Add(notification, profile_);
Peter Beverloo 2016/04/18 14:57:09 How do you imagine this will be updated with deleg
Miguel Garcia 2016/04/19 14:24:57 Once we start getting mojo objects instead of Noti
+}
+
+void ChromeNotificationDisplayService::Close(
+ const std::string& notification_id) {
+ ui_manager_->CancelById(notification_id,
+ NotificationUIManager::GetProfileID(profile_));
+}
+
+bool ChromeNotificationDisplayService::GetDisplayed(
+ std::set<std::string>* notifications) const {
+ DCHECK(notifications);
+ for (auto notification_id : ui_manager_->GetAllIdsByProfile(
+ NotificationUIManager::GetProfileID(profile_))) {
+ notifications->insert(notification_id);
+ }
+ return true;
+}
+
+bool ChromeNotificationDisplayService::SupportsNotificationCenter() const {
+ return false;
+}

Powered by Google App Engine
This is Rietveld 408576698