OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_VIEWS_MESSAGE_CENTER_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
7 | 7 |
8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
9 | 9 |
10 #include "ui/base/animation/animation_delegate.h" | 10 #include "ui/base/animation/animation_delegate.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 virtual ~MessageCenterView(); | 47 virtual ~MessageCenterView(); |
48 | 48 |
49 void SetNotifications(const NotificationList::Notifications& notifications); | 49 void SetNotifications(const NotificationList::Notifications& notifications); |
50 | 50 |
51 void ClearAllNotifications(); | 51 void ClearAllNotifications(); |
52 void OnAllNotificationsCleared(); | 52 void OnAllNotificationsCleared(); |
53 | 53 |
54 size_t NumMessageViewsForTest() const; | 54 size_t NumMessageViewsForTest() const; |
55 | 55 |
56 void SetSettingsVisible(bool visible); | 56 void SetSettingsVisible(bool visible); |
| 57 void OnSettingsChanged(); |
57 bool settings_visible() const { return settings_visible_; } | 58 bool settings_visible() const { return settings_visible_; } |
58 | 59 |
59 void SetIsClosing(bool is_closing); | 60 void SetIsClosing(bool is_closing); |
60 | 61 |
61 protected: | 62 protected: |
62 // Overridden from views::View: | 63 // Overridden from views::View: |
63 virtual void Layout() OVERRIDE; | 64 virtual void Layout() OVERRIDE; |
64 virtual gfx::Size GetPreferredSize() OVERRIDE; | 65 virtual gfx::Size GetPreferredSize() OVERRIDE; |
65 virtual int GetHeightForWidth(int width) OVERRIDE; | 66 virtual int GetHeightForWidth(int width) OVERRIDE; |
66 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; | 67 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
79 | 80 |
80 private: | 81 private: |
81 friend class MessageCenterViewTest; | 82 friend class MessageCenterViewTest; |
82 | 83 |
83 void AddNotificationAt(const Notification& notification, int index); | 84 void AddNotificationAt(const Notification& notification, int index); |
84 void NotificationsChanged(); | 85 void NotificationsChanged(); |
85 void SetNotificationViewForTest(views::View* view); | 86 void SetNotificationViewForTest(views::View* view); |
86 | 87 |
87 MessageCenter* message_center_; // Weak reference. | 88 MessageCenter* message_center_; // Weak reference. |
88 MessageCenterTray* tray_; // Weak reference. | 89 MessageCenterTray* tray_; // Weak reference. |
89 std::vector<MessageView*> message_views_; | 90 std::vector<MessageView*> message_views_; // Weak references. |
| 91 |
| 92 // Child views. |
90 views::ScrollView* scroller_; | 93 views::ScrollView* scroller_; |
91 MessageListView* message_list_view_; | 94 MessageListView* message_list_view_; |
92 NotifierSettingsView* settings_view_; | 95 NotifierSettingsView* settings_view_; |
93 MessageCenterButtonBar* button_bar_; | 96 MessageCenterButtonBar* button_bar_; |
94 views::View* no_notifications_message_view_; | 97 views::View* no_notifications_message_view_; |
95 bool top_down_; | 98 bool top_down_; |
96 | 99 |
97 // Data for transition animation between settings view and message list. | 100 // Data for transition animation between settings view and message list. |
98 bool settings_visible_; | 101 bool settings_visible_; |
| 102 |
| 103 // Animation managing transition between message center and settings (and vice |
| 104 // versa). |
| 105 scoped_ptr<ui::MultiAnimation> settings_transition_animation_; |
| 106 |
| 107 // Helper data to keep track of the transition between settings and |
| 108 // message center views. |
99 views::View* source_view_; | 109 views::View* source_view_; |
| 110 int source_height_; |
100 views::View* target_view_; | 111 views::View* target_view_; |
101 int source_height_; | |
102 int target_height_; | 112 int target_height_; |
103 scoped_ptr<ui::MultiAnimation> settings_transition_animation_; | |
104 | 113 |
105 // True when the widget is closing so that further operations should be | 114 // True when the widget is closing so that further operations should be |
106 // ignored. | 115 // ignored. |
107 bool is_closing_; | 116 bool is_closing_; |
108 | 117 |
109 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); | 118 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); |
110 }; | 119 }; |
111 | 120 |
112 } // namespace message_center | 121 } // namespace message_center |
113 | 122 |
114 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ | 123 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
OLD | NEW |