Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: ui/message_center/notification.cc

Issue 15582004: Move NotificationDelegate into message_center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the ever-changing Mac unit tests. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/notification.h ('k') | ui/message_center/notification_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/notification.cc
diff --git a/ui/message_center/notification.cc b/ui/message_center/notification.cc
index e6f66aede4101f6582940fca55a4cb166a5889b4..c4db2d50b17585d63211e2f7fa7c1776c4b405cf 100644
--- a/ui/message_center/notification.cc
+++ b/ui/message_center/notification.cc
@@ -29,20 +29,22 @@ Notification::Notification(NotificationType type,
const string16& message,
const string16& display_source,
const std::string& extension_id,
- const DictionaryValue* optional_fields)
- : type_(type),
- id_(id),
- title_(title),
- message_(message),
- display_source_(display_source),
- extension_id_(extension_id),
- priority_(DEFAULT_PRIORITY),
- timestamp_(base::Time::Now()),
- serial_number_(g_next_serial_number_++),
- shown_as_popup_(false),
- is_read_(false),
- is_expanded_(false),
- never_timeout_(false) {
+ const DictionaryValue* optional_fields,
+ NotificationDelegate* delegate)
+ : type_(type),
+ id_(id),
+ title_(title),
+ message_(message),
+ display_source_(display_source),
+ extension_id_(extension_id),
+ priority_(DEFAULT_PRIORITY),
+ timestamp_(base::Time::Now()),
+ serial_number_(g_next_serial_number_++),
+ shown_as_popup_(false),
+ is_read_(false),
+ is_expanded_(false),
+ never_timeout_(false),
+ delegate_(delegate) {
// This can override some data members initialized to deafule values above.
ApplyOptionalFields(optional_fields);
}
@@ -55,6 +57,8 @@ void Notification::CopyState(Notification* base) {
is_read_ = base->is_read();
is_expanded_ = base->is_expanded();
never_timeout_ = base->never_timeout();
+ if (!delegate_.get())
+ delegate_ = base->delegate();
}
bool Notification::SetButtonIcon(size_t index, const gfx::Image& icon) {
« no previous file with comments | « ui/message_center/notification.h ('k') | ui/message_center/notification_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698