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

Side by Side Diff: ui/message_center/notification_view.h

Issue 12277024: Notificaitons refactor step 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed latest nits 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 "ui/message_center/message_view.h" 8 #include "ui/message_center/message_view.h"
9 #include "ui/message_center/notification_list.h" 9 #include "ui/message_center/notification_list.h"
10 10
11 namespace message_center { 11 namespace message_center {
12 12
13 // View that displays all current types of notification (web, basic, image, and 13 // 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 14 // list). Future notification types may be handled by other classes, in which
15 // case instances of those classes would be returned by the 15 // case instances of those classes would be returned by the
16 // ViewForNotification() factory method below. 16 // ViewForNotification() factory method below.
17 class NotificationView : public MessageView { 17 class NotificationView : public MessageView {
18 public: 18 public:
19 // Creates appropriate MessageViews for notifications. Those currently are 19 // Creates appropriate MessageViews for notifications. Those currently are
20 // always NotificationView instances but in the future may be instances of 20 // always NotificationView instances but in the future may be instances of
21 // other classes, with the class depending on the notification type. 21 // other classes, with the class depending on the notification type.
22 static MessageView* ViewForNotification( 22 static MessageView* ViewForNotification(
23 const Notification& notification, 23 Notification* notification,
24 NotificationList::Delegate* list_delegate); 24 NotificationList::Delegate* list_delegate);
25 25
26 NotificationView(NotificationList::Delegate* list_delegate, 26 NotificationView(NotificationList::Delegate* list_delegate,
27 const Notification& notification); 27 Notification* notification);
28 virtual ~NotificationView(); 28 virtual ~NotificationView();
29 29
30 // Overridden from View. 30 // Overridden from View.
31 virtual void Layout() OVERRIDE; 31 virtual void Layout() OVERRIDE;
32 virtual gfx::Size GetPreferredSize() OVERRIDE; 32 virtual gfx::Size GetPreferredSize() OVERRIDE;
33 33
34 // Overridden from MessageView. 34 // Overridden from MessageView.
35 virtual void SetUpView() OVERRIDE; 35 virtual void SetUpView() OVERRIDE;
36 virtual void ButtonPressed(views::Button* sender, 36 virtual void ButtonPressed(views::Button* sender,
37 const ui::Event& event) OVERRIDE; 37 const ui::Event& event) OVERRIDE;
38 38
39 private: 39 private:
40 views::View* MakeContentView(); 40 views::View* MakeContentView();
41 41
42 views::View* content_view_; 42 views::View* content_view_;
43 std::vector<views::Button*> action_buttons_; 43 std::vector<views::Button*> action_buttons_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(NotificationView); 45 DISALLOW_COPY_AND_ASSIGN(NotificationView);
46 }; 46 };
47 47
48 } // namespace message_center 48 } // namespace message_center
49 49
50 #endif // UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_ 50 #endif // UI_MESSAGE_CENTER_NOTIFICATION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698