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

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: 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 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>
dharcourt 2013/02/23 04:32:00 Better to have this here explicitly since we use a
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
16 // ViewForNotification() factory method below. 18 // ViewForNotification() factory 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 instances but in the future may be instances of
21 // other classes, with the class depending on the notification type. 23 // other classes, with the class depending on the notification type.
22 static MessageView* ViewForNotification( 24 static MessageView* ViewForNotification(
23 const Notification& notification, 25 const Notification& notification,
24 NotificationList::Delegate* list_delegate); 26 NotificationList::Delegate* list_delegate);
25 27
26 NotificationView(NotificationList::Delegate* list_delegate, 28 NotificationView(NotificationList::Delegate* list_delegate,
27 const Notification& notification); 29 const Notification& notification);
28 virtual ~NotificationView(); 30 virtual ~NotificationView();
29 31
30 // Overridden from View. 32 // Overridden from View.
31 virtual void Layout() OVERRIDE; 33 virtual void Layout() OVERRIDE;
32 virtual gfx::Size GetPreferredSize() OVERRIDE; 34 virtual gfx::Size GetPreferredSize() OVERRIDE;
35 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
33 36
34 // Overridden from MessageView. 37 // Overridden from MessageView.
35 virtual void SetUpView() OVERRIDE; 38 virtual void SetExpanded(bool expanded) OVERRIDE;
36 virtual void ButtonPressed(views::Button* sender, 39 virtual void ButtonPressed(views::Button* sender,
37 const ui::Event& event) OVERRIDE; 40 const ui::Event& event) OVERRIDE;
38 41
39 private: 42 private:
40 views::View* MakeContentView(); 43 views::View* MakeContentView();
41 44
42 views::View* content_view_; 45 views::View* content_view_;
46 views::ImageView* icon_view_;
43 std::vector<views::Button*> action_buttons_; 47 std::vector<views::Button*> action_buttons_;
44 48
45 DISALLOW_COPY_AND_ASSIGN(NotificationView); 49 DISALLOW_COPY_AND_ASSIGN(NotificationView);
46 }; 50 };
47 51
48 } // namespace message_center 52 } // namespace message_center
49 53
50 #endif // UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_ 54 #endif // UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698