| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 Notification(const std::string& id, const Notification& notification); | 37 Notification(const std::string& id, const Notification& notification); |
| 38 | 38 |
| 39 Notification(const Notification& notification); | 39 Notification(const Notification& notification); |
| 40 ~Notification() override; | 40 ~Notification() override; |
| 41 Notification& operator=(const Notification& notification); | 41 Notification& operator=(const Notification& notification); |
| 42 | 42 |
| 43 // A unique identifier used to update (replace) or remove a notification. | 43 // A unique identifier used to update (replace) or remove a notification. |
| 44 const std::string& tag() const { return tag_; } | 44 const std::string& tag() const { return tag_; } |
| 45 | 45 |
| 46 const GURL& service_worker_scope() const { return service_worker_scope_; } |
| 47 void set_service_worker_scope(const GURL& service_worker_scope) { |
| 48 service_worker_scope_ = service_worker_scope; |
| 49 } |
| 50 |
| 46 // Id of the delegate embedded inside this instance. | 51 // Id of the delegate embedded inside this instance. |
| 47 std::string delegate_id() const { return delegate()->id(); } | 52 std::string delegate_id() const { return delegate()->id(); } |
| 48 | 53 |
| 49 NotificationDelegate* delegate() const { return delegate_.get(); } | 54 NotificationDelegate* delegate() const { return delegate_.get(); } |
| 50 | 55 |
| 51 private: | 56 private: |
| 52 // The user-supplied tag for the notification. | 57 // The user-supplied tag for the notification. |
| 53 std::string tag_; | 58 std::string tag_; |
| 54 | 59 |
| 60 // The service worker scope if the notification was displayed by a service |
| 61 // worker. Used by WebAPKs. |
| 62 GURL service_worker_scope_; |
| 63 |
| 55 // A proxy object that allows access back to the JavaScript object that | 64 // A proxy object that allows access back to the JavaScript object that |
| 56 // represents the notification, for firing events. | 65 // represents the notification, for firing events. |
| 57 scoped_refptr<NotificationDelegate> delegate_; | 66 scoped_refptr<NotificationDelegate> delegate_; |
| 58 }; | 67 }; |
| 59 | 68 |
| 60 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ | 69 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ |
| OLD | NEW |