OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_PERSISTENT_NOTIFICATION_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chrome/browser/notifications/notification_delegate.h" |
| 11 #include "content/public/common/show_desktop_notification_params.h" |
| 12 |
| 13 namespace content { |
| 14 class BrowserContext; |
| 15 } |
| 16 |
| 17 // Delegate responsible for listening to the click event on persistent |
| 18 // notifications, to forward them to the PlatformNotificationService so that |
| 19 // JavaScript events can be fired on the associated Service Worker. |
| 20 class PersistentNotificationDelegate : public NotificationDelegate { |
| 21 public: |
| 22 PersistentNotificationDelegate( |
| 23 content::BrowserContext* browser_context, |
| 24 int64 service_worker_registration_id, |
| 25 const content::ShowDesktopNotificationHostMsgParams& params); |
| 26 |
| 27 // NotificationDelegate implementation. |
| 28 void Display() override; |
| 29 void Close(bool by_user) override; |
| 30 void Click() override; |
| 31 std::string id() const override; |
| 32 |
| 33 protected: |
| 34 ~PersistentNotificationDelegate() override; |
| 35 |
| 36 private: |
| 37 content::BrowserContext* browser_context_; |
| 38 int64 service_worker_registration_id_; |
| 39 content::ShowDesktopNotificationHostMsgParams notification_data_; |
| 40 |
| 41 std::string id_; |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_ |
OLD | NEW |