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

Side by Side Diff: chrome/browser/notifications/notification_display_service.h

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 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_
7
8 #include <set>
9 #include "base/macros.h"
10 #include "components/keyed_service/core/keyed_service.h"
11 #include "ui/message_center/notification.h"
12
13 class Notification;
Peter Beverloo 2016/03/21 15:57:04 You both include the message_center::Notification
Miguel Garcia 2016/04/11 19:51:26 Done.
14 class Profile;
15
16 class NotificationDisplayService : public KeyedService {
Peter Beverloo 2016/03/21 15:57:03 ++docs
Miguel Garcia 2016/04/11 19:51:26 Done.
17 public:
18 static NotificationDisplayService* Create(Profile* profile);
Peter Beverloo 2016/03/21 15:57:04 Can we try to have the creation logic in Notificat
Miguel Garcia 2016/03/21 17:43:02 No, this won't work for mac because we would need
Miguel Garcia 2016/04/11 19:51:26 Reworked a bit after chatting offline, *most* of t
19
20 // Shows a toast on string using the data passed in |notification|.
21 virtual void Display(const Notification& notification) = 0;
Peter Beverloo 2016/03/21 15:57:04 Why won't we need to pass the |notification_id| he
Miguel Garcia 2016/03/21 17:43:03 Sure, originally you mentioned that the Notificati
Miguel Garcia 2016/04/11 19:51:26 Added now, this highlights how mac right now does
22
23 // Closes a nofication. Returns wether a notiication was actually closed.
24 virtual bool Close(const std::string& notification_id) = 0;
Peter Beverloo 2016/03/21 15:57:04 What are we going to use the returned boolean for?
Miguel Garcia 2016/03/21 17:43:03 I can remove it. This was something the old ui man
25
26
27 // Return a set of notification ids currently being displayed either as popups
28 // or in the native platform's notification center.
29 virtual std::set<std::string> GetDisplayed() const = 0;
Peter Beverloo 2016/03/21 15:57:03 This needs some way to indicate whether the list o
Miguel Garcia 2016/03/21 17:43:02 ok
Miguel Garcia 2016/04/11 19:51:26 Done.
30
31 // Temporary method while we finish the refactor
32 virtual bool SupportsNotificationCenter() const = 0;
33
34 protected:
Peter Beverloo 2016/03/21 15:57:03 What interfaces do have are virtual destructors :-
Peter Beverloo 2016/03/21 15:57:04 This is an interface, and interfaces don't have me
Miguel Garcia 2016/03/21 17:43:03 I would like to avoid having to pass and store the
Miguel Garcia 2016/03/21 17:43:03 ? do, have, are? In general keyservice destructio
Miguel Garcia 2016/04/11 19:51:26 Reluctantly added it to each subclass :(
35 explicit NotificationDisplayService(Profile* profile);
36 Profile* profile_; // weak
37
38 private:
39 DISALLOW_COPY_AND_ASSIGN(NotificationDisplayService);
40 };
41
42 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698