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

Side by Side 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: Rebased, which led to many changes. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_ 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_
6 #define UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_ 6 #define UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_
7 7
8 #include <vector>
9
8 #include "ui/message_center/message_view.h" 10 #include "ui/message_center/message_view.h"
9 #include "ui/message_center/notification_list.h" 11 #include "ui/message_center/notification_list.h"
10 12
11 namespace message_center { 13 namespace message_center {
12 14
13 // View that displays all current types of notification (web, basic, image, and 15 // View that displays all current types of notification (web, basic, image, and
14 // list). Future notification types may be handled by other classes, in which 16 // list). Future notification types may be handled by other classes, in which
15 // case instances of those classes would be returned by the 17 // case instances of those classes would be returned by the Create() factory
16 // ViewForNotification() factory method below. 18 // method below.
17 class NotificationView : public MessageView { 19 class NotificationView : public MessageView {
18 public: 20 public:
19 // Creates appropriate MessageViews for notifications. Those currently are 21 // Creates appropriate MessageViews for notifications. Those currently are
20 // always NotificationView instances but in the future may be instances of 22 // always NotificationView or MessageSimpleView instances but in the future
21 // other classes, with the class depending on the notification type. 23 // may be instances of other classes, with the class depending on the
24 // notification type.
22 static MessageView* Create(const Notification& notification, 25 static MessageView* Create(const Notification& notification,
23 NotificationList::Delegate* list_delegate); 26 NotificationList::Delegate* delegate,
27 bool expanded);
24 28
25 virtual ~NotificationView(); 29 virtual ~NotificationView();
26 30
27 // Overridden from View. 31 // Overridden from views::View:
28 virtual void Layout() OVERRIDE; 32 virtual void Layout() OVERRIDE;
29 virtual gfx::Size GetPreferredSize() OVERRIDE; 33 virtual gfx::Size GetPreferredSize() OVERRIDE;
30 34
31 // Overridden from MessageView. 35 // Overridden from MessageView:
36 virtual void Update(const Notification& notification) OVERRIDE;
32 virtual void ButtonPressed(views::Button* sender, 37 virtual void ButtonPressed(views::Button* sender,
33 const ui::Event& event) OVERRIDE; 38 const ui::Event& event) OVERRIDE;
34 39
35 private: 40 private:
36 NotificationView(NotificationList::Delegate* list_delegate, 41 NotificationView(const Notification& notification,
37 const Notification& notification); 42 NotificationList::Delegate* delegate,
43 bool expanded);
38 44
39 views::View* MakeContentView(const Notification& notification); 45 void AddChildViews(const Notification& notification);
46 void AddContentView(const Notification& notification);
40 47
41 views::View* content_view_; 48 views::View* content_view_;
49 views::ImageView* icon_view_;
42 std::vector<views::Button*> action_buttons_; 50 std::vector<views::Button*> action_buttons_;
43 51
44 DISALLOW_COPY_AND_ASSIGN(NotificationView); 52 DISALLOW_COPY_AND_ASSIGN(NotificationView);
45 }; 53 };
46 54
47 } // namespace message_center 55 } // namespace message_center
48 56
49 #endif // UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_ 57 #endif // UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698