Index: ui/message_center/message_view.h |
diff --git a/ui/message_center/message_view.h b/ui/message_center/message_view.h |
index be36eb4edc6bd6ff7d9dc89c164602dbd2f4c1f0..3eae1f70f7cfee9f945c5288378c30d4831a7ce4 100644 |
--- a/ui/message_center/message_view.h |
+++ b/ui/message_center/message_view.h |
@@ -29,14 +29,16 @@ const int kWebNotificationWidth = 300; |
class MessageView : public views::SlideOutView, |
public views::ButtonListener { |
public: |
- MessageView(NotificationList::Delegate* list_delegate, |
- const Notification& notification); |
+ MessageView(NotificationList::Delegate* list_delegate); |
virtual ~MessageView(); |
// Creates the elements that make up the view layout. Must be called |
- // immediately after construction. |
- virtual void SetUpView() = 0; |
+ // immediately after construction. Derived classes must call the base |
+ // class' implementation first. |
+ // The view should not cache a reference to notification, since Notification |
+ // may be destroyed before the view. |
+ virtual void SetUpView(const Notification& notification); |
stevenjb
2013/02/25 23:55:56
message_view.cc does not appear to have uploaded c
Dmitry Titov
2013/02/26 01:01:51
Done. Removed this virtual completely, moved some
|
void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; } |
@@ -60,13 +62,18 @@ class MessageView : public views::SlideOutView, |
virtual void OnSlideOut() OVERRIDE; |
NotificationList::Delegate* list_delegate() { return list_delegate_; } |
- Notification& notification() { return notification_; } |
+ const std::string& notification_id() { return notification_id_; } |
+ const string16& display_source() const { return display_source_; } |
+ const std::string& extension_id() const { return extension_id_; } |
views::ImageButton* close_button() { return close_button_.get(); } |
views::ScrollView* scroller() { return scroller_; } |
private: |
- NotificationList::Delegate* list_delegate_; |
- Notification notification_; |
+ NotificationList::Delegate* list_delegate_; // Weak, global (MessageCenter). |
+ std::string notification_id_; |
+ string16 display_source_; |
+ std::string extension_id_; |
+ |
scoped_ptr<views::ImageButton> close_button_; |
views::ScrollView* scroller_; |