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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 Notification(const Notification& notification); | 50 Notification(const Notification& notification); |
51 virtual ~Notification(); | 51 virtual ~Notification(); |
52 Notification& operator=(const Notification& notification); | 52 Notification& operator=(const Notification& notification); |
53 | 53 |
54 // The origin URL of the script which requested the notification. | 54 // The origin URL of the script which requested the notification. |
55 const GURL& origin_url() const { return origin_url_; } | 55 const GURL& origin_url() const { return origin_url_; } |
56 | 56 |
57 // A unique identifier used to update (replace) or remove a notification. | 57 // A unique identifier used to update (replace) or remove a notification. |
58 const base::string16& replace_id() const { return replace_id_; } | 58 const base::string16& replace_id() const { return replace_id_; } |
59 | 59 |
60 // A url for the button icons to be shown (optional). | |
61 const GURL& button_one_icon_url() const { return button_one_icon_url_; } | |
62 const GURL& button_two_icon_url() const { return button_two_icon_url_; } | |
63 | |
64 // A url for the image to be shown (optional). | |
65 const GURL& image_url() const { return image_url_; } | |
66 | |
67 // Id of the delegate embedded inside this instance. | 60 // Id of the delegate embedded inside this instance. |
68 std::string delegate_id() const { return delegate()->id(); } | 61 std::string delegate_id() const { return delegate()->id(); } |
69 | 62 |
70 NotificationDelegate* delegate() const { return delegate_.get(); } | 63 NotificationDelegate* delegate() const { return delegate_.get(); } |
71 | 64 |
72 private: | 65 private: |
73 // The Origin of the page/worker which created this notification. | 66 // The Origin of the page/worker which created this notification. |
74 GURL origin_url_; | 67 GURL origin_url_; |
75 | 68 |
76 // The URLs of the button images for a rich notification. | |
77 GURL button_one_icon_url_; | |
78 GURL button_two_icon_url_; | |
79 | |
80 // The URL of a large image to be displayed for a a rich notification. | |
81 GURL image_url_; | |
82 | |
83 // The user-supplied replace ID for the notification. | 69 // The user-supplied replace ID for the notification. |
84 base::string16 replace_id_; | 70 base::string16 replace_id_; |
85 | 71 |
86 // A proxy object that allows access back to the JavaScript object that | 72 // A proxy object that allows access back to the JavaScript object that |
87 // represents the notification, for firing events. | 73 // represents the notification, for firing events. |
88 scoped_refptr<NotificationDelegate> delegate_; | 74 scoped_refptr<NotificationDelegate> delegate_; |
89 }; | 75 }; |
90 | 76 |
91 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ | 77 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ |
OLD | NEW |