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