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

Side by Side Diff: chrome/browser/notifications/message_center_display_service.cc

Issue 2917923004: Move handler processing to NotificationDisplayService
Patch Set: Created 3 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "chrome/browser/notifications/message_center_display_service.h" 8 #include "chrome/browser/notifications/message_center_display_service.h"
9 9
10 #include "chrome/browser/notifications/notification.h" 10 #include "chrome/browser/notifications/notification.h"
11 #include "chrome/browser/notifications/notification_ui_manager.h" 11 #include "chrome/browser/notifications/notification_ui_manager.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
14 14
15 MessageCenterDisplayService::MessageCenterDisplayService( 15 MessageCenterDisplayService::MessageCenterDisplayService(
16 Profile* profile, 16 Profile* profile,
17 NotificationUIManager* ui_manager) 17 NotificationUIManager* ui_manager)
18 : profile_(profile), ui_manager_(ui_manager) {} 18 : NotificationDisplayService(profile),
19 profile_(profile),
20 ui_manager_(ui_manager) {}
19 21
20 MessageCenterDisplayService::~MessageCenterDisplayService() {} 22 MessageCenterDisplayService::~MessageCenterDisplayService() {}
21 23
22 void MessageCenterDisplayService::Display( 24 void MessageCenterDisplayService::Display(
23 NotificationCommon::Type notification_type, 25 NotificationCommon::Type notification_type,
24 const std::string& notification_id, 26 const std::string& notification_id,
25 const Notification& notification) { 27 const Notification& notification) {
26 // TODO(miguelg): MCDS should stop relying on the |notification|'s delegate 28 // TODO(miguelg): MCDS should stop relying on the |notification|'s delegate
27 // for Close/Click operations once the Notification object becomes a mojom 29 // for Close/Click operations once the Notification object becomes a mojom
28 // type. 30 // type.
(...skipping 11 matching lines...) Expand all
40 const DisplayedNotificationsCallback& callback) { 42 const DisplayedNotificationsCallback& callback) {
41 auto displayed_notifications = 43 auto displayed_notifications =
42 base::MakeUnique<std::set<std::string>>(ui_manager_->GetAllIdsByProfile( 44 base::MakeUnique<std::set<std::string>>(ui_manager_->GetAllIdsByProfile(
43 NotificationUIManager::GetProfileID(profile_))); 45 NotificationUIManager::GetProfileID(profile_)));
44 46
45 content::BrowserThread::PostTask( 47 content::BrowserThread::PostTask(
46 content::BrowserThread::UI, FROM_HERE, 48 content::BrowserThread::UI, FROM_HERE,
47 base::BindOnce(callback, base::Passed(&displayed_notifications), 49 base::BindOnce(callback, base::Passed(&displayed_notifications),
48 true /* supports_synchronization */)); 50 true /* supports_synchronization */));
49 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698