Chromium Code Reviews| 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 base { | |
| 16 class SequencedTaskRunner; | |
| 17 } | |
| 18 | |
| 19 namespace dbus { | |
| 20 class Bus; | |
| 21 } | |
| 22 | |
| 15 class NotificationPlatformBridgeLinux : public NotificationPlatformBridge { | 23 class NotificationPlatformBridgeLinux : public NotificationPlatformBridge { |
| 16 public: | 24 public: |
| 17 NotificationPlatformBridgeLinux(); | 25 NotificationPlatformBridgeLinux(); |
| 18 | 26 |
| 19 ~NotificationPlatformBridgeLinux() override; | 27 ~NotificationPlatformBridgeLinux() override; |
| 20 | 28 |
| 21 // NotificationPlatformBridge: | 29 // NotificationPlatformBridge: |
| 22 void Display(NotificationCommon::Type notification_type, | 30 void Display(NotificationCommon::Type notification_type, |
| 23 const std::string& notification_id, | 31 const std::string& notification_id, |
| 24 const std::string& profile_id, | 32 const std::string& profile_id, |
| 25 bool is_incognito, | 33 bool is_incognito, |
| 26 const Notification& notification) override; | 34 const Notification& notification) override; |
| 27 void Close(const std::string& profile_id, | 35 void Close(const std::string& profile_id, |
| 28 const std::string& notification_id) override; | 36 const std::string& notification_id) override; |
| 29 void GetDisplayed( | 37 void GetDisplayed( |
| 30 const std::string& profile_id, | 38 const std::string& profile_id, |
| 31 bool incognito, | 39 bool incognito, |
| 32 const GetDisplayedNotificationsCallback& callback) const override; | 40 const GetDisplayedNotificationsCallback& callback) const override; |
| 33 void SetReadyCallback(NotificationBridgeReadyCallback callback) override; | 41 void SetReadyCallback(NotificationBridgeReadyCallback callback) override; |
| 34 | 42 |
| 35 private: | 43 private: |
| 44 friend class NotificationPlatformBridgeLinuxTest; | |
| 45 | |
| 46 NotificationPlatformBridgeLinux( | |
|
Lei Zhang
2017/04/29 01:35:05
This is for testing only, right? Add a comment?
Tom (Use chromium acct)
2017/05/01 18:25:29
Done.
| |
| 47 scoped_refptr<base::SequencedTaskRunner> notification_task_runner, | |
| 48 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | |
| 49 scoped_refptr<dbus::Bus> bus); | |
| 50 | |
| 51 void CleanUp(); | |
| 52 | |
| 36 scoped_refptr<NotificationPlatformBridgeLinuxImpl> impl_; | 53 scoped_refptr<NotificationPlatformBridgeLinuxImpl> impl_; |
| 37 | 54 |
| 38 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinux); | 55 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinux); |
| 39 }; | 56 }; |
| 40 | 57 |
| 41 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ | 58 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ |
| OLD | NEW |