| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // A url for the button icons to be shown (optional). | 67 // A url for the button icons to be shown (optional). |
| 68 const GURL& button_one_icon_url() const { return button_one_icon_url_; } | 68 const GURL& button_one_icon_url() const { return button_one_icon_url_; } |
| 69 const GURL& button_two_icon_url() const { return button_two_icon_url_; } | 69 const GURL& button_two_icon_url() const { return button_two_icon_url_; } |
| 70 | 70 |
| 71 // A url for the image to be shown (optional). | 71 // A url for the image to be shown (optional). |
| 72 const GURL& image_url() const { return image_url_; } | 72 const GURL& image_url() const { return image_url_; } |
| 73 | 73 |
| 74 // Id of the delegate embedded inside this instance. | 74 // Id of the delegate embedded inside this instance. |
| 75 std::string delegate_id() const { return delegate()->id(); } | 75 std::string delegate_id() const { return delegate()->id(); } |
| 76 | 76 |
| 77 content::WebContents* GetWebContents() const { | |
| 78 return delegate()->GetWebContents(); | |
| 79 } | |
| 80 void DoneRendering() { delegate()->ReleaseRenderViewHost(); } | |
| 81 | |
| 82 NotificationDelegate* delegate() const { return delegate_.get(); } | 77 NotificationDelegate* delegate() const { return delegate_.get(); } |
| 83 | 78 |
| 84 private: | 79 private: |
| 85 // The Origin of the page/worker which created this notification. | 80 // The Origin of the page/worker which created this notification. |
| 86 GURL origin_url_; | 81 GURL origin_url_; |
| 87 | 82 |
| 88 // URL for the icon associated with the notification. Requires delegate_ | 83 // URL for the icon associated with the notification. Requires delegate_ |
| 89 // to have a non NULL RenderViewHost. | 84 // to have a non NULL RenderViewHost. |
| 90 GURL icon_url_; | 85 GURL icon_url_; |
| 91 | 86 |
| 92 // The URLs of the button images for a rich notification. | 87 // The URLs of the button images for a rich notification. |
| 93 GURL button_one_icon_url_; | 88 GURL button_one_icon_url_; |
| 94 GURL button_two_icon_url_; | 89 GURL button_two_icon_url_; |
| 95 | 90 |
| 96 // The URL of a large image to be displayed for a a rich notification. | 91 // The URL of a large image to be displayed for a a rich notification. |
| 97 GURL image_url_; | 92 GURL image_url_; |
| 98 | 93 |
| 99 // The URL of a small image to be displayed for a a rich notification. | |
| 100 GURL small_image_url_; | |
| 101 | |
| 102 // The user-supplied replace ID for the notification. | 94 // The user-supplied replace ID for the notification. |
| 103 base::string16 replace_id_; | 95 base::string16 replace_id_; |
| 104 | 96 |
| 105 // A proxy object that allows access back to the JavaScript object that | 97 // A proxy object that allows access back to the JavaScript object that |
| 106 // represents the notification, for firing events. | 98 // represents the notification, for firing events. |
| 107 scoped_refptr<NotificationDelegate> delegate_; | 99 scoped_refptr<NotificationDelegate> delegate_; |
| 108 }; | 100 }; |
| 109 | 101 |
| 110 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ | 102 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ |
| OLD | NEW |