| 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 #include "chrome/browser/notifications/notification.h" | 5 #include "chrome/browser/notifications/notification.h" |
| 6 | 6 |
| 7 Notification::Notification(const GURL& origin_url, | 7 Notification::Notification(const GURL& origin_url, |
| 8 const GURL& icon_url, | 8 const GURL& icon_url, |
| 9 const base::string16& title, | 9 const base::string16& title, |
| 10 const base::string16& body, | 10 const base::string16& body, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 notifier_id, | 47 notifier_id, |
| 48 rich_notification_data, | 48 rich_notification_data, |
| 49 delegate), | 49 delegate), |
| 50 origin_url_(origin_url), | 50 origin_url_(origin_url), |
| 51 replace_id_(replace_id), | 51 replace_id_(replace_id), |
| 52 delegate_(delegate) { | 52 delegate_(delegate) { |
| 53 // It's important to leave |icon_url_| empty with rich notifications enabled, | 53 // It's important to leave |icon_url_| empty with rich notifications enabled, |
| 54 // to prevent "Downloading" the data url and overwriting the existing |icon|. | 54 // to prevent "Downloading" the data url and overwriting the existing |icon|. |
| 55 } | 55 } |
| 56 | 56 |
| 57 Notification::Notification(const GURL& origin_url, | |
| 58 const gfx::Image& icon, | |
| 59 const base::string16& title, | |
| 60 const base::string16& body, | |
| 61 blink::WebTextDirection dir, | |
| 62 const base::string16& display_source, | |
| 63 const base::string16& replace_id, | |
| 64 NotificationDelegate* delegate) | |
| 65 : message_center::Notification(message_center::NOTIFICATION_TYPE_SIMPLE, | |
| 66 delegate->id(), | |
| 67 title, | |
| 68 body, | |
| 69 icon, | |
| 70 display_source, | |
| 71 message_center::NotifierId(origin_url), | |
| 72 message_center::RichNotificationData(), | |
| 73 delegate), | |
| 74 origin_url_(origin_url), | |
| 75 replace_id_(replace_id), | |
| 76 delegate_(delegate) {} | |
| 77 | |
| 78 Notification::Notification(const Notification& notification) | 57 Notification::Notification(const Notification& notification) |
| 79 : message_center::Notification(notification), | 58 : message_center::Notification(notification), |
| 80 origin_url_(notification.origin_url()), | 59 origin_url_(notification.origin_url()), |
| 81 icon_url_(notification.icon_url()), | 60 icon_url_(notification.icon_url()), |
| 82 button_one_icon_url_(notification.button_one_icon_url()), | 61 button_one_icon_url_(notification.button_one_icon_url()), |
| 83 button_two_icon_url_(notification.button_two_icon_url()), | 62 button_two_icon_url_(notification.button_two_icon_url()), |
| 84 image_url_(notification.image_url()), | 63 image_url_(notification.image_url()), |
| 85 replace_id_(notification.replace_id()), | 64 replace_id_(notification.replace_id()), |
| 86 delegate_(notification.delegate()) {} | 65 delegate_(notification.delegate()) {} |
| 87 | 66 |
| 88 Notification::~Notification() {} | 67 Notification::~Notification() {} |
| 89 | 68 |
| 90 Notification& Notification::operator=(const Notification& notification) { | 69 Notification& Notification::operator=(const Notification& notification) { |
| 91 message_center::Notification::operator=(notification); | 70 message_center::Notification::operator=(notification); |
| 92 origin_url_ = notification.origin_url(); | 71 origin_url_ = notification.origin_url(); |
| 93 icon_url_ = notification.icon_url(); | 72 icon_url_ = notification.icon_url(); |
| 94 button_one_icon_url_ = notification.button_one_icon_url(); | 73 button_one_icon_url_ = notification.button_one_icon_url(); |
| 95 button_two_icon_url_ = notification.button_two_icon_url(); | 74 button_two_icon_url_ = notification.button_two_icon_url(); |
| 96 image_url_ = notification.image_url(); | 75 image_url_ = notification.image_url(); |
| 97 replace_id_ = notification.replace_id(); | 76 replace_id_ = notification.replace_id(); |
| 98 delegate_ = notification.delegate(); | 77 delegate_ = notification.delegate(); |
| 99 return *this; | 78 return *this; |
| 100 } | 79 } |
| OLD | NEW |