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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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/notifications/chrome_notification_display_service.h"
6
7 #include "chrome/browser/notifications/notification.h"
8 #include "chrome/browser/notifications/notification_ui_manager.h"
9 #include "chrome/browser/profiles/profile.h"
10
11 ChromeNotificationDisplayService::ChromeNotificationDisplayService(
12 Profile* profile,
13 NotificationUIManager* ui_manager)
14 : profile_(profile), ui_manager_(ui_manager) {}
15
16 ChromeNotificationDisplayService::~ChromeNotificationDisplayService() {}
17
18 void ChromeNotificationDisplayService::Display(
19 const std::string& notification_id,
20 const Notification& notification) {
21 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
22 }
23
24 void ChromeNotificationDisplayService::Close(
25 const std::string& notification_id) {
26 ui_manager_->CancelById(notification_id,
27 NotificationUIManager::GetProfileID(profile_));
28 }
29
30 bool ChromeNotificationDisplayService::GetDisplayed(
31 std::set<std::string>* notifications) const {
32 DCHECK(notifications);
33 for (auto notification_id : ui_manager_->GetAllIdsByProfile(
34 NotificationUIManager::GetProfileID(profile_))) {
35 notifications->insert(notification_id);
36 }
37 return true;
38 }
39
40 bool ChromeNotificationDisplayService::SupportsNotificationCenter() const {
41 return false;
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698