OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 UI_MESSAGE_CENTER_NOTIFICATION_H_ | 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_H_ |
6 #define UI_MESSAGE_CENTER_NOTIFICATION_H_ | 6 #define UI_MESSAGE_CENTER_NOTIFICATION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 | 165 |
166 int progress() const { return optional_fields_.progress; } | 166 int progress() const { return optional_fields_.progress; } |
167 void set_progress(int progress) { optional_fields_.progress = progress; } | 167 void set_progress(int progress) { optional_fields_.progress = progress; } |
168 // End unpacked values. | 168 // End unpacked values. |
169 | 169 |
170 // Images fetched asynchronously. | 170 // Images fetched asynchronously. |
171 const gfx::Image& icon() const { return icon_; } | 171 const gfx::Image& icon() const { return icon_; } |
172 void set_icon(const gfx::Image& icon) { icon_ = icon; } | 172 void set_icon(const gfx::Image& icon) { icon_ = icon; } |
173 | 173 |
174 // Gets and sets whether to draw a solid background colour behind the | |
175 // notification's icon. Only applies to the Views implementation. | |
176 bool draw_icon_background() const { return draw_icon_background_; } | |
177 void set_draw_icon_background(bool draw) { draw_icon_background_ = draw; } | |
178 | |
179 const gfx::Image& image() const { return optional_fields_.image; } | 174 const gfx::Image& image() const { return optional_fields_.image; } |
180 void set_image(const gfx::Image& image) { optional_fields_.image = image; } | 175 void set_image(const gfx::Image& image) { optional_fields_.image = image; } |
181 | 176 |
182 const gfx::Image& small_image() const { return optional_fields_.small_image; } | 177 const gfx::Image& small_image() const { return optional_fields_.small_image; } |
183 void set_small_image(const gfx::Image& image) { | 178 void set_small_image(const gfx::Image& image) { |
184 optional_fields_.small_image = image; | 179 optional_fields_.small_image = image; |
185 } | 180 } |
186 | 181 |
187 // Buttons, with icons fetched asynchronously. | 182 // Buttons, with icons fetched asynchronously. |
188 const std::vector<ButtonInfo>& buttons() const { | 183 const std::vector<ButtonInfo>& buttons() const { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // The type of notification we'd like displayed. | 256 // The type of notification we'd like displayed. |
262 NotificationType type_; | 257 NotificationType type_; |
263 | 258 |
264 std::string id_; | 259 std::string id_; |
265 base::string16 title_; | 260 base::string16 title_; |
266 base::string16 message_; | 261 base::string16 message_; |
267 | 262 |
268 // Image data for the associated icon, used by Ash when available. | 263 // Image data for the associated icon, used by Ash when available. |
269 gfx::Image icon_; | 264 gfx::Image icon_; |
270 | 265 |
271 // True by default; controls whether to draw a solid background colour behind | |
272 // the |icon_|. Only applies to the Views implementation. | |
273 bool draw_icon_background_; | |
274 | |
275 // The display string for the source of the notification. Could be | 266 // The display string for the source of the notification. Could be |
276 // the same as origin_url_, or the name of an extension. | 267 // the same as origin_url_, or the name of an extension. |
277 base::string16 display_source_; | 268 base::string16 display_source_; |
278 | 269 |
279 private: | 270 private: |
280 // The origin URL of the script which requested the notification. | 271 // The origin URL of the script which requested the notification. |
281 // Can be empty if requested through a chrome app or extension or if | 272 // Can be empty if requested through a chrome app or extension or if |
282 // it's a system notification. | 273 // it's a system notification. |
283 GURL origin_url_; | 274 GURL origin_url_; |
284 NotifierId notifier_id_; | 275 NotifierId notifier_id_; |
285 unsigned serial_number_; | 276 unsigned serial_number_; |
286 RichNotificationData optional_fields_; | 277 RichNotificationData optional_fields_; |
287 bool shown_as_popup_; // True if this has been shown as a popup. | 278 bool shown_as_popup_; // True if this has been shown as a popup. |
288 bool is_read_; // True if this has been seen in the message center. | 279 bool is_read_; // True if this has been seen in the message center. |
289 | 280 |
290 // A proxy object that allows access back to the JavaScript object that | 281 // A proxy object that allows access back to the JavaScript object that |
291 // represents the notification, for firing events. | 282 // represents the notification, for firing events. |
292 scoped_refptr<NotificationDelegate> delegate_; | 283 scoped_refptr<NotificationDelegate> delegate_; |
293 }; | 284 }; |
294 | 285 |
295 } // namespace message_center | 286 } // namespace message_center |
296 | 287 |
297 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ | 288 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ |
OLD | NEW |