OLD | NEW |
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 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/notifications/notification_common.h" |
12 | 13 |
13 class Notification; | 14 class Notification; |
14 | 15 |
15 // Provides the low-level interface that enables notifications to be displayed | 16 // Provides the low-level interface that enables notifications to be displayed |
16 // and interacted with on the user's screen, orthogonal of whether this | 17 // and interacted with on the user's screen, orthogonal of whether this |
17 // functionality is provided by the browser or by the operating system. | 18 // functionality is provided by the browser or by the operating system. |
18 // TODO(miguelg): Add support for click and close events. | 19 // TODO(miguelg): Add support for click and close events. |
19 class NotificationPlatformBridge { | 20 class NotificationPlatformBridge { |
20 public: | 21 public: |
21 static NotificationPlatformBridge* Create(); | 22 static NotificationPlatformBridge* Create(); |
22 | 23 |
23 virtual ~NotificationPlatformBridge() {} | 24 virtual ~NotificationPlatformBridge() {} |
24 | 25 |
25 // Shows a toast on screen using the data passed in |notification|. | 26 // Shows a toast on screen using the data passed in |notification|. |
26 virtual void Display(const std::string& notification_id, | 27 virtual void Display(NotificationCommon::Type notification_type, |
| 28 const std::string& notification_id, |
27 const std::string& profile_id, | 29 const std::string& profile_id, |
28 bool is_incognito, | 30 bool is_incognito, |
29 const Notification& notification) = 0; | 31 const Notification& notification) = 0; |
30 | 32 |
31 // Closes a nofication with |notification_id| and |profile_id| if being | 33 // Closes a nofication with |notification_id| and |profile_id| if being |
32 // displayed. | 34 // displayed. |
33 virtual void Close(const std::string& profile_id, | 35 virtual void Close(const std::string& profile_id, |
34 const std::string& notification_id) = 0; | 36 const std::string& notification_id) = 0; |
35 | 37 |
36 // Fills in |notifications| with a set of notification ids currently being | 38 // Fills in |notifications| with a set of notification ids currently being |
(...skipping 12 matching lines...) Expand all Loading... |
49 virtual bool SupportsNotificationCenter() const = 0; | 51 virtual bool SupportsNotificationCenter() const = 0; |
50 | 52 |
51 protected: | 53 protected: |
52 NotificationPlatformBridge() {} | 54 NotificationPlatformBridge() {} |
53 | 55 |
54 private: | 56 private: |
55 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridge); | 57 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridge); |
56 }; | 58 }; |
57 | 59 |
58 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_H_ | 60 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_H_ |
OLD | NEW |