OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_LINUX_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "chrome/browser/notifications/notification_platform_bridge.h" | 11 #include "chrome/browser/notifications/notification_platform_bridge.h" |
12 | 12 |
13 class NotificationPlatformBridgeLinuxImpl; | 13 class NotificationPlatformBridgeLinuxImpl; |
14 | 14 |
| 15 namespace dbus { |
| 16 class Bus; |
| 17 } |
| 18 |
15 class NotificationPlatformBridgeLinux : public NotificationPlatformBridge { | 19 class NotificationPlatformBridgeLinux : public NotificationPlatformBridge { |
16 public: | 20 public: |
17 NotificationPlatformBridgeLinux(); | 21 NotificationPlatformBridgeLinux(); |
18 | 22 |
19 ~NotificationPlatformBridgeLinux() override; | 23 ~NotificationPlatformBridgeLinux() override; |
20 | 24 |
21 // NotificationPlatformBridge: | 25 // NotificationPlatformBridge: |
22 void Display(NotificationCommon::Type notification_type, | 26 void Display(NotificationCommon::Type notification_type, |
23 const std::string& notification_id, | 27 const std::string& notification_id, |
24 const std::string& profile_id, | 28 const std::string& profile_id, |
25 bool is_incognito, | 29 bool is_incognito, |
26 const Notification& notification) override; | 30 const Notification& notification) override; |
27 void Close(const std::string& profile_id, | 31 void Close(const std::string& profile_id, |
28 const std::string& notification_id) override; | 32 const std::string& notification_id) override; |
29 void GetDisplayed( | 33 void GetDisplayed( |
30 const std::string& profile_id, | 34 const std::string& profile_id, |
31 bool incognito, | 35 bool incognito, |
32 const GetDisplayedNotificationsCallback& callback) const override; | 36 const GetDisplayedNotificationsCallback& callback) const override; |
33 void SetReadyCallback(NotificationBridgeReadyCallback callback) override; | 37 void SetReadyCallback(NotificationBridgeReadyCallback callback) override; |
34 | 38 |
35 private: | 39 private: |
| 40 friend class NotificationPlatformBridgeLinuxTest; |
| 41 |
| 42 // Constructor only used in unit testing. |
| 43 explicit NotificationPlatformBridgeLinux(scoped_refptr<dbus::Bus> bus); |
| 44 |
| 45 void CleanUp(); |
| 46 |
36 scoped_refptr<NotificationPlatformBridgeLinuxImpl> impl_; | 47 scoped_refptr<NotificationPlatformBridgeLinuxImpl> impl_; |
37 | 48 |
38 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinux); | 49 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinux); |
39 }; | 50 }; |
40 | 51 |
41 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ | 52 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ |
OLD | NEW |