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 #include "ui/message_center/notification.h" | 5 #include "ui/message_center/notification.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/message_center/notification_delegate.h" | 8 #include "ui/message_center/notification_delegate.h" |
9 #include "ui/message_center/notification_types.h" | 9 #include "ui/message_center/notification_types.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 unsigned g_next_serial_number_ = 0; | 12 unsigned g_next_serial_number_ = 0; |
13 } | 13 } |
14 | 14 |
15 namespace message_center { | 15 namespace message_center { |
16 | 16 |
17 NotificationItem::NotificationItem(const string16& title, | 17 NotificationItem::NotificationItem(const base::string16& title, |
18 const string16& message) | 18 const base::string16& message) |
19 : title(title), | 19 : title(title), |
20 message(message) { | 20 message(message) { |
21 } | 21 } |
22 | 22 |
23 ButtonInfo::ButtonInfo(const string16& title) | 23 ButtonInfo::ButtonInfo(const base::string16& title) |
24 : title(title) { | 24 : title(title) { |
25 } | 25 } |
26 | 26 |
27 RichNotificationData::RichNotificationData() | 27 RichNotificationData::RichNotificationData() |
28 : priority(DEFAULT_PRIORITY), | 28 : priority(DEFAULT_PRIORITY), |
29 never_timeout(false), | 29 never_timeout(false), |
30 timestamp(base::Time::Now()), | 30 timestamp(base::Time::Now()), |
31 progress(0), | 31 progress(0), |
32 should_make_spoken_feedback_for_popup_updates(true), | 32 should_make_spoken_feedback_for_popup_updates(true), |
33 clickable(true) {} | 33 clickable(true) {} |
34 | 34 |
35 RichNotificationData::RichNotificationData(const RichNotificationData& other) | 35 RichNotificationData::RichNotificationData(const RichNotificationData& other) |
36 : priority(other.priority), | 36 : priority(other.priority), |
37 never_timeout(other.never_timeout), | 37 never_timeout(other.never_timeout), |
38 timestamp(other.timestamp), | 38 timestamp(other.timestamp), |
39 expanded_message(other.expanded_message), | 39 expanded_message(other.expanded_message), |
40 context_message(other.context_message), | 40 context_message(other.context_message), |
41 image(other.image), | 41 image(other.image), |
42 items(other.items), | 42 items(other.items), |
43 progress(other.progress), | 43 progress(other.progress), |
44 buttons(other.buttons), | 44 buttons(other.buttons), |
45 should_make_spoken_feedback_for_popup_updates( | 45 should_make_spoken_feedback_for_popup_updates( |
46 other.should_make_spoken_feedback_for_popup_updates), | 46 other.should_make_spoken_feedback_for_popup_updates), |
47 clickable(other.clickable) {} | 47 clickable(other.clickable) {} |
48 | 48 |
49 RichNotificationData::~RichNotificationData() {} | 49 RichNotificationData::~RichNotificationData() {} |
50 | 50 |
51 Notification::Notification(NotificationType type, | 51 Notification::Notification(NotificationType type, |
52 const std::string& id, | 52 const std::string& id, |
53 const string16& title, | 53 const base::string16& title, |
54 const string16& message, | 54 const base::string16& message, |
55 const gfx::Image& icon, | 55 const gfx::Image& icon, |
56 const string16& display_source, | 56 const base::string16& display_source, |
57 const NotifierId& notifier_id, | 57 const NotifierId& notifier_id, |
58 const RichNotificationData& optional_fields, | 58 const RichNotificationData& optional_fields, |
59 NotificationDelegate* delegate) | 59 NotificationDelegate* delegate) |
60 : type_(type), | 60 : type_(type), |
61 id_(id), | 61 id_(id), |
62 title_(title), | 62 title_(title), |
63 message_(message), | 63 message_(message), |
64 icon_(icon), | 64 icon_(icon), |
65 display_source_(display_source), | 65 display_source_(display_source), |
66 notifier_id_(notifier_id), | 66 notifier_id_(notifier_id), |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 icon, | 147 icon, |
148 base::string16() /* display_source */, | 148 base::string16() /* display_source */, |
149 NotifierId(NotifierId::SYSTEM_COMPONENT, system_component_id), | 149 NotifierId(NotifierId::SYSTEM_COMPONENT, system_component_id), |
150 RichNotificationData(), | 150 RichNotificationData(), |
151 new HandleNotificationClickedDelegate(click_callback))); | 151 new HandleNotificationClickedDelegate(click_callback))); |
152 notification->SetSystemPriority(); | 152 notification->SetSystemPriority(); |
153 return notification.Pass(); | 153 return notification.Pass(); |
154 } | 154 } |
155 | 155 |
156 } // namespace message_center | 156 } // namespace message_center |
OLD | NEW |