1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEWS_H_
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEWS_H_
8 #include "ui/views/view.h"
10 #include "ui/message_center/message_center_export.h"
11 #include "ui/message_center/notification_list.h"
17 namespace message_center
{
19 class MessageCenterBubble
;
21 class NotificationChangeObserver
;
23 // MessageCenterButtonBar //////////////////////////////////////////////////////
25 // If you know how to better hide this implementation class please do so, and
26 // otherwise please refrain from using it :-).
27 class MessageCenterButtonBar
: public views::View
{
29 explicit MessageCenterButtonBar(NotificationChangeObserver
* observer
);
30 virtual ~MessageCenterButtonBar();
32 void SetCloseAllVisible(bool visible
);
35 NotificationChangeObserver
* observer() { return observer_
; }
36 views::Button
* close_all_button() { return close_all_button_
; }
37 void set_close_all_button(views::Button
* button
) {
38 close_all_button_
= button
;
42 NotificationChangeObserver
* observer_
; // Weak reference.
43 views::Button
* close_all_button_
;
45 DISALLOW_COPY_AND_ASSIGN(MessageCenterButtonBar
);
48 // MessageCenterView ///////////////////////////////////////////////////////////
50 class MESSAGE_CENTER_EXPORT MessageCenterView
: public views::View
{
52 MessageCenterView(NotificationChangeObserver
* observer
, int max_height
);
53 virtual ~MessageCenterView();
55 void SetNotifications(const NotificationList::Notifications
& notifications
);
57 size_t NumMessageViewsForTest() const;
60 // Overridden from views::View:
61 virtual void Layout() OVERRIDE
;
62 virtual bool OnMouseWheel(const ui::MouseWheelEvent
& event
) OVERRIDE
;
65 friend class MessageCenterViewTest
;
67 void RemoveAllNotifications();
68 void AddNotification(const Notification
& notification
);
70 NotificationChangeObserver
* observer_
; // Weak reference.
71 std::map
<std::string
,MessageView
*> message_views_
;
72 views::ScrollView
* scroller_
;
73 views::View
* message_list_view_
;
74 MessageCenterButtonBar
* button_bar_
;
76 DISALLOW_COPY_AND_ASSIGN(MessageCenterView
);
79 } // namespace message_center
81 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEWS_H_