| 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 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if (index >= optional_fields_.buttons.size()) | 119 if (index >= optional_fields_.buttons.size()) |
| 120 return; | 120 return; |
| 121 optional_fields_.buttons[index].icon = icon; | 121 optional_fields_.buttons[index].icon = icon; |
| 122 } | 122 } |
| 123 | 123 |
| 124 void Notification::SetSystemPriority() { | 124 void Notification::SetSystemPriority() { |
| 125 optional_fields_.priority = SYSTEM_PRIORITY; | 125 optional_fields_.priority = SYSTEM_PRIORITY; |
| 126 optional_fields_.never_timeout = true; | 126 optional_fields_.never_timeout = true; |
| 127 } | 127 } |
| 128 | 128 |
| 129 // static | |
| 130 scoped_ptr<Notification> Notification::CreateSystemNotification( | |
| 131 const std::string& notification_id, | |
| 132 const base::string16& title, | |
| 133 const base::string16& message, | |
| 134 const gfx::Image& icon, | |
| 135 const std::string& system_component_id, | |
| 136 const base::Closure& click_callback) { | |
| 137 scoped_ptr<Notification> notification( | |
| 138 new Notification( | |
| 139 NOTIFICATION_TYPE_SIMPLE, | |
| 140 notification_id, | |
| 141 title, | |
| 142 message, | |
| 143 icon, | |
| 144 base::string16() /* display_source */, | |
| 145 NotifierId(NotifierId::SYSTEM_COMPONENT, system_component_id), | |
| 146 RichNotificationData(), | |
| 147 new HandleNotificationClickedDelegate(click_callback))); | |
| 148 notification->SetSystemPriority(); | |
| 149 return notification.Pass(); | |
| 150 } | |
| 151 | |
| 152 } // namespace message_center | 129 } // namespace message_center |
| OLD | NEW |