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 content::WebContents* GetWebContents() const { | |
61 return delegate()->GetWebContents(); | |
62 } | |
63 void DoneRendering() { delegate()->ReleaseRenderViewHost(); } | |
Peter Beverloo
2014/09/19 11:27:46
nit: These changes were part of my CL, and should
Jun Mukai
2014/09/19 22:34:29
rebased.
| |
64 | |
65 NotificationDelegate* delegate() const { return delegate_.get(); } | 53 NotificationDelegate* delegate() const { return delegate_.get(); } |
66 | 54 |
67 private: | 55 private: |
68 // The Origin of the page/worker which created this notification. | 56 // The Origin of the page/worker which created this notification. |
69 GURL origin_url_; | 57 GURL origin_url_; |
70 | 58 |
71 // The URLs of the button images for a rich notification. | |
72 GURL button_one_icon_url_; | |
73 GURL button_two_icon_url_; | |
74 | |
75 // The URL of a large image to be displayed for a a rich notification. | |
76 GURL image_url_; | |
77 | |
78 // The URL of a small image to be displayed for a a rich notification. | |
79 GURL small_image_url_; | |
80 | |
81 // The user-supplied replace ID for the notification. | 59 // The user-supplied replace ID for the notification. |
82 base::string16 replace_id_; | 60 base::string16 replace_id_; |
83 | 61 |
84 // 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 |
85 // represents the notification, for firing events. | 63 // represents the notification, for firing events. |
86 scoped_refptr<NotificationDelegate> delegate_; | 64 scoped_refptr<NotificationDelegate> delegate_; |
87 }; | 65 }; |
88 | 66 |
89 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ | 67 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ |
OLD | NEW |