OLD | NEW |
---|---|
(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 <string> | |
10 #include "base/macros.h" | |
11 #include "components/keyed_service/core/keyed_service.h" | |
12 | |
13 class Notification; | |
14 class NotificationBridge; | |
15 class Profile; | |
16 | |
17 // A class to display and interact with notifications in the different | |
18 // notification centers. | |
Peter Beverloo
2016/04/18 14:57:09
// Profile-bound service that enables notification
Miguel Garcia
2016/04/19 14:24:57
Done.
| |
19 class NotificationDisplayService : public KeyedService { | |
20 public: | |
21 NotificationDisplayService() {} | |
22 ~NotificationDisplayService() override {} | |
23 | |
24 // Shows a toast on string using the data passed in |notification|. | |
Peter Beverloo
2016/04/18 14:57:09
// Displays the |notification| identified by |noti
Miguel Garcia
2016/04/19 14:24:57
Not on mac (nor Android I think).If Windows offers
| |
25 virtual void Display(const std::string& notification_id, | |
26 const Notification& notification) = 0; | |
27 | |
28 // Closes a notification. | |
Peter Beverloo
2016/04/18 14:57:09
// Closes the notification identified by |notifica
Miguel Garcia
2016/04/19 14:24:57
Done.
| |
29 virtual void Close(const std::string& notification_id) = 0; | |
30 | |
31 // Fills in |notifications| with a set of notification ids currently being | |
32 // displayed either as popups or in the native platform's notification | |
33 // center. | |
34 // The return value expresses whether the underlying platform has the | |
35 // capability to provide displayed notifications so the empty set | |
36 // can be disambiguated. | |
Peter Beverloo
2016/04/18 14:57:09
// Returns whether the implementation can retrieve
Miguel Garcia
2016/04/19 14:24:57
Done.
| |
37 virtual bool GetDisplayed(std::set<std::string>* notifications) const = 0; | |
38 | |
39 // Temporary method while we finish the refactor. Returns whether there is | |
40 // a native notification center backing up notifications. | |
41 virtual bool SupportsNotificationCenter() const = 0; | |
42 | |
43 private: | |
44 DISALLOW_COPY_AND_ASSIGN(NotificationDisplayService); | |
45 }; | |
46 | |
47 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_ | |
OLD | NEW |