Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ui / message_center / views / message_center_view.h
blob720dd4bce75c7e062b839da26110a02866a1064e
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"
13 namespace views {
14 class Button;
15 } // namespace views
17 namespace message_center {
19 class MessageCenterBubble;
20 class MessageView;
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 {
28 public:
29 explicit MessageCenterButtonBar(NotificationChangeObserver* observer);
30 virtual ~MessageCenterButtonBar();
32 void SetCloseAllVisible(bool visible);
34 protected:
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;
41 private:
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 {
51 public:
52 MessageCenterView(NotificationChangeObserver* observer, int max_height);
53 virtual ~MessageCenterView();
55 void SetNotifications(const NotificationList::Notifications& notifications);
57 size_t NumMessageViewsForTest() const;
59 protected:
60 // Overridden from views::View:
61 virtual void Layout() OVERRIDE;
62 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
64 private:
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_