| 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 base::string16& title, | 8 const base::string16& title, |
| 9 const base::string16& body, | 9 const base::string16& body, |
| 10 const gfx::Image& icon, | 10 const gfx::Image& icon, |
| 11 const base::string16& display_source, | 11 const base::string16& display_source, |
| 12 const std::string& tag, | 12 const std::string& tag, |
| 13 NotificationDelegate* delegate) | 13 NotificationDelegate* delegate) |
| 14 : message_center::Notification(message_center::NOTIFICATION_TYPE_SIMPLE, | 14 : message_center::Notification(message_center::NOTIFICATION_TYPE_SIMPLE, |
| 15 delegate->id(), | 15 delegate->id(), |
| 16 title, | 16 title, |
| 17 body, | 17 body, |
| 18 icon, | 18 icon, |
| 19 display_source, | 19 display_source, |
| 20 origin_url, |
| 20 message_center::NotifierId(origin_url), | 21 message_center::NotifierId(origin_url), |
| 21 message_center::RichNotificationData(), | 22 message_center::RichNotificationData(), |
| 22 delegate), | 23 delegate), |
| 23 origin_url_(origin_url), | |
| 24 tag_(tag), | 24 tag_(tag), |
| 25 delegate_(delegate) {} | 25 delegate_(delegate) {} |
| 26 | 26 |
| 27 Notification::Notification( | 27 Notification::Notification( |
| 28 message_center::NotificationType type, | 28 message_center::NotificationType type, |
| 29 const GURL& origin_url, | |
| 30 const base::string16& title, | 29 const base::string16& title, |
| 31 const base::string16& body, | 30 const base::string16& body, |
| 32 const gfx::Image& icon, | 31 const gfx::Image& icon, |
| 33 const message_center::NotifierId& notifier_id, | 32 const message_center::NotifierId& notifier_id, |
| 34 const base::string16& display_source, | 33 const base::string16& display_source, |
| 34 const GURL& origin_url, |
| 35 const std::string& tag, | 35 const std::string& tag, |
| 36 const message_center::RichNotificationData& rich_notification_data, | 36 const message_center::RichNotificationData& rich_notification_data, |
| 37 NotificationDelegate* delegate) | 37 NotificationDelegate* delegate) |
| 38 : message_center::Notification(type, | 38 : message_center::Notification(type, |
| 39 delegate->id(), | 39 delegate->id(), |
| 40 title, | 40 title, |
| 41 body, | 41 body, |
| 42 icon, | 42 icon, |
| 43 display_source, | 43 display_source, |
| 44 origin_url, |
| 44 notifier_id, | 45 notifier_id, |
| 45 rich_notification_data, | 46 rich_notification_data, |
| 46 delegate), | 47 delegate), |
| 47 origin_url_(origin_url), | |
| 48 tag_(tag), | 48 tag_(tag), |
| 49 delegate_(delegate) {} | 49 delegate_(delegate) {} |
| 50 | 50 |
| 51 Notification::Notification(const std::string& id, | 51 Notification::Notification(const std::string& id, |
| 52 const Notification& notification) | 52 const Notification& notification) |
| 53 : message_center::Notification(id, notification), | 53 : message_center::Notification(id, notification), |
| 54 origin_url_(notification.origin_url()), | |
| 55 tag_(notification.tag()), | 54 tag_(notification.tag()), |
| 56 delegate_(notification.delegate()) { | 55 delegate_(notification.delegate()) { |
| 57 } | 56 } |
| 58 | 57 |
| 59 Notification::Notification(const Notification& notification) | 58 Notification::Notification(const Notification& notification) |
| 60 : message_center::Notification(notification), | 59 : message_center::Notification(notification), |
| 61 origin_url_(notification.origin_url()), | |
| 62 tag_(notification.tag()), | 60 tag_(notification.tag()), |
| 63 delegate_(notification.delegate()) {} | 61 delegate_(notification.delegate()) {} |
| 64 | 62 |
| 65 Notification::~Notification() {} | 63 Notification::~Notification() {} |
| 66 | 64 |
| 67 Notification& Notification::operator=(const Notification& notification) { | 65 Notification& Notification::operator=(const Notification& notification) { |
| 68 message_center::Notification::operator=(notification); | 66 message_center::Notification::operator=(notification); |
| 69 origin_url_ = notification.origin_url(); | |
| 70 tag_ = notification.tag(); | 67 tag_ = notification.tag(); |
| 71 delegate_ = notification.delegate(); | 68 delegate_ = notification.delegate(); |
| 72 return *this; | 69 return *this; |
| 73 } | 70 } |
| OLD | NEW |