| 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_MESSAGE_CENTER_DISPLAY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_DISPLAY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_DISPLAY_SERVICE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_DISPLAY_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/notifications/notification_display_service.h" | 9 #include "chrome/browser/notifications/notification_display_service.h" |
| 10 #include "chrome/browser/notifications/notification_operation_common.h" |
| 10 | 11 |
| 11 class Notification; | 12 class Notification; |
| 12 class NotificationUIManager; | 13 class NotificationUIManager; |
| 13 class Profile; | 14 class Profile; |
| 14 | 15 |
| 15 // Implementation of display service for notifications displayed by chrome | 16 // Implementation of display service for notifications displayed by chrome |
| 16 // instead of the native platform notification center. | 17 // instead of the native platform notification center. |
| 17 class MessageCenterDisplayService : public NotificationDisplayService { | 18 class MessageCenterDisplayService : public NotificationDisplayService { |
| 18 public: | 19 public: |
| 19 MessageCenterDisplayService(Profile* profile, | 20 MessageCenterDisplayService(Profile* profile, |
| 20 NotificationUIManager* ui_manager); | 21 NotificationUIManager* ui_manager); |
| 21 ~MessageCenterDisplayService() override; | 22 ~MessageCenterDisplayService() override; |
| 22 | 23 |
| 23 // NotificationDisplayService implementation. | 24 // NotificationDisplayService implementation. |
| 24 void Display(const std::string& notification_id, | 25 void Display( |
| 25 const Notification& notification) override; | 26 notification_operation_common::NotificationHandlerType notification_type, |
| 26 void Close(const std::string& notification_id) override; | 27 const std::string& notification_id, |
| 28 const Notification& notification) override; |
| 29 void Close( |
| 30 notification_operation_common::NotificationHandlerType notification_type, |
| 31 const std::string& notification_id) override; |
| 27 bool GetDisplayed(std::set<std::string>* notifications) const override; | 32 bool GetDisplayed(std::set<std::string>* notifications) const override; |
| 33 void ProcessNotificationOperation( |
| 34 notification_operation_common::NotificationOperation operation, |
| 35 notification_operation_common::NotificationHandlerType notification_type, |
| 36 const std::string& origin, |
| 37 const std::string& notification_id, |
| 38 int action_index) override; |
| 28 bool SupportsNotificationCenter() const override; | 39 bool SupportsNotificationCenter() const override; |
| 29 | 40 |
| 30 private: | 41 private: |
| 31 Profile* profile_; | 42 Profile* profile_; |
| 32 NotificationUIManager* ui_manager_; | 43 NotificationUIManager* ui_manager_; |
| 33 | 44 |
| 34 DISALLOW_COPY_AND_ASSIGN(MessageCenterDisplayService); | 45 DISALLOW_COPY_AND_ASSIGN(MessageCenterDisplayService); |
| 35 }; | 46 }; |
| 36 | 47 |
| 37 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_DISPLAY_SERVICE_H_ | 48 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_DISPLAY_SERVICE_H_ |
| OLD | NEW |