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

Unified Diff: ui/message_center/notification_view.h

Issue 12326091: Made notification center notifications collapsed and expandable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implemented review suggestions. Created 7 years, 10 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_view.h
diff --git a/ui/message_center/notification_view.h b/ui/message_center/notification_view.h
index 144893198adbcfc7d95b0495f1dabb7f0befcaf0..c02f1993bee7c0dc8d4cc0d90385aa18e5861c95 100644
--- a/ui/message_center/notification_view.h
+++ b/ui/message_center/notification_view.h
@@ -5,40 +5,49 @@
#ifndef UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_
#define UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_
+#include <vector>
+
#include "ui/message_center/message_view.h"
-#include "ui/message_center/notification_list.h"
namespace message_center {
+class NotificationChangeDelegate;
+
// View that displays all current types of notification (web, basic, image, and
// list). Future notification types may be handled by other classes, in which
-// case instances of those classes would be returned by the
-// ViewForNotification() factory method below.
+// case instances of those classes would be returned by the Create() factory
+// method below.
class NotificationView : public MessageView {
public:
// Creates appropriate MessageViews for notifications. Those currently are
- // always NotificationView instances but in the future may be instances of
- // other classes, with the class depending on the notification type.
+ // always NotificationView or MessageSimpleView instances but in the future
+ // may be instances of other classes, with the class depending on the
+ // notification type.
static MessageView* Create(const Notification& notification,
- NotificationList::Delegate* list_delegate);
+ NotificationChangeDelegate* delegate,
+ bool expanded);
virtual ~NotificationView();
- // Overridden from View.
+ // Overridden from views::View:
virtual void Layout() OVERRIDE;
virtual gfx::Size GetPreferredSize() OVERRIDE;
- // Overridden from MessageView.
+ // Overridden from MessageView:
+ virtual void Update(const Notification& notification) OVERRIDE;
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
private:
- NotificationView(NotificationList::Delegate* list_delegate,
- const Notification& notification);
+ NotificationView(const Notification& notification,
+ NotificationChangeDelegate* delegate,
+ bool expanded);
- views::View* MakeContentView(const Notification& notification);
+ void AddChildViews(const Notification& notification);
+ void AddContentView(const Notification& notification);
views::View* content_view_;
+ views::ImageView* icon_view_;
std::vector<views::Button*> action_buttons_;
DISALLOW_COPY_AND_ASSIGN(NotificationView);

Powered by Google App Engine
This is Rietveld 408576698