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

Side by Side Diff: chrome/browser/notifications/message_center_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/message_center_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 MessageCenterDisplayService::MessageCenterDisplayService(
12 Profile* profile,
13 NotificationUIManager* ui_manager)
14 : profile_(profile), ui_manager_(ui_manager) {}
15
16 MessageCenterDisplayService::~MessageCenterDisplayService() {}
17
18 void MessageCenterDisplayService::Display(const std::string& notification_id,
19 const Notification& notification) {
20 ui_manager_->Add(notification, profile_);
21 }
22
23 void MessageCenterDisplayService::Close(const std::string& notification_id) {
24 ui_manager_->CancelById(notification_id,
25 NotificationUIManager::GetProfileID(profile_));
26 }
27
28 bool MessageCenterDisplayService::GetDisplayed(
29 std::set<std::string>* notifications) const {
30 DCHECK(notifications);
31 for (auto notification_id : ui_manager_->GetAllIdsByProfile(
32 NotificationUIManager::GetProfileID(profile_))) {
33 notifications->insert(notification_id);
34 }
35 return true;
36 }
37
38 bool MessageCenterDisplayService::SupportsNotificationCenter() const {
39 return false;
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698