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

Unified Diff: ui/message_center/notification.h

Issue 15582004: Move NotificationDelegate into message_center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Win browsertests. 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
Index: ui/message_center/notification.h
diff --git a/ui/message_center/notification.h b/ui/message_center/notification.h
index ec66e1d1e1171f08934a603b4b70245cb2160601..5f7ee12a4523e48ca4464f154fe476220176a1af 100644
--- a/ui/message_center/notification.h
+++ b/ui/message_center/notification.h
@@ -13,6 +13,7 @@
#include "base/values.h"
#include "ui/gfx/image/image.h"
#include "ui/message_center/message_center_export.h"
+#include "ui/message_center/notification_delegate.h"
#include "ui/message_center/notification_types.h"
namespace message_center {
@@ -39,7 +40,8 @@ class MESSAGE_CENTER_EXPORT Notification {
const string16& message,
const string16& display_source,
const std::string& extension_id,
- const DictionaryValue* optional_fields); // May be NULL.
+ const DictionaryValue* optional_fields, // May be NULL.
+ NotificationDelegate* delegate); // May be NULL.
virtual ~Notification();
// Copies the internal on-memory state from |base|, i.e. shown_as_popup,
@@ -89,6 +91,7 @@ class MESSAGE_CENTER_EXPORT Notification {
unsigned serial_number() { return serial_number_; }
bool never_timeout() const { return never_timeout_; }
+ NotificationDelegate* delegate() { return delegate_.get(); }
private:
// Unpacks the provided |optional_fields| and applies the values to override
@@ -114,6 +117,10 @@ class MESSAGE_CENTER_EXPORT Notification {
bool is_expanded_; // True if this has been expanded in the message center.
bool never_timeout_; // True if it doesn't timeout when it appears as a toast.
+ // A proxy object that allows access back to the JavaScript object that
+ // represents the notification, for firing events.
+ scoped_refptr<NotificationDelegate> delegate_;
+
DISALLOW_COPY_AND_ASSIGN(Notification);
};

Powered by Google App Engine
This is Rietveld 408576698