| 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_types.h" | 8 #include "ui/message_center/notification_types.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 const DictionaryValue* optional_fields) | 32 const DictionaryValue* optional_fields) |
| 33 : type_(type), | 33 : type_(type), |
| 34 id_(id), | 34 id_(id), |
| 35 title_(title), | 35 title_(title), |
| 36 message_(message), | 36 message_(message), |
| 37 display_source_(display_source), | 37 display_source_(display_source), |
| 38 extension_id_(extension_id), | 38 extension_id_(extension_id), |
| 39 priority_(DEFAULT_PRIORITY), | 39 priority_(DEFAULT_PRIORITY), |
| 40 timestamp_(base::Time::Now()), | 40 timestamp_(base::Time::Now()), |
| 41 serial_number_(g_next_serial_number_++), | 41 serial_number_(g_next_serial_number_++), |
| 42 shown_as_popup_(false), |
| 42 is_read_(false), | 43 is_read_(false), |
| 43 shown_as_popup_(false) { | 44 is_expanded_(false) { |
| 44 // This can override some data members initialized to deafule values above. | 45 // This can override some data members initialized to deafule values above. |
| 45 ApplyOptionalFields(optional_fields); | 46 ApplyOptionalFields(optional_fields); |
| 46 } | 47 } |
| 47 | 48 |
| 48 Notification::~Notification() { | 49 Notification::~Notification() { |
| 49 } | 50 } |
| 50 | 51 |
| 51 bool Notification::SetButtonIcon(size_t index, const gfx::ImageSkia& icon) { | 52 bool Notification::SetButtonIcon(size_t index, const gfx::ImageSkia& icon) { |
| 52 if (index >= buttons_.size()) | 53 if (index >= buttons_.size()) |
| 53 return false; | 54 return false; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 const base::DictionaryValue* item; | 89 const base::DictionaryValue* item; |
| 89 items->GetDictionary(i, &item); | 90 items->GetDictionary(i, &item); |
| 90 item->GetString(kItemTitleKey, &title); | 91 item->GetString(kItemTitleKey, &title); |
| 91 item->GetString(kItemMessageKey, &message); | 92 item->GetString(kItemMessageKey, &message); |
| 92 items_.push_back(NotificationItem(title, message)); | 93 items_.push_back(NotificationItem(title, message)); |
| 93 } | 94 } |
| 94 } | 95 } |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace message_center | 98 } // namespace message_center |
| OLD | NEW |