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

Side by Side Diff: ui/message_center/views/message_center_view.h

Issue 1961803002: Remove NoNotificationMessageView from empty message center (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests of "mode". Created 4 years, 7 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
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void ClickOnSettingsButton(const std::string& notification_id) override; 88 void ClickOnSettingsButton(const std::string& notification_id) override;
89 89
90 // Overridden from gfx::AnimationDelegate: 90 // Overridden from gfx::AnimationDelegate:
91 void AnimationEnded(const gfx::Animation* animation) override; 91 void AnimationEnded(const gfx::Animation* animation) override;
92 void AnimationProgressed(const gfx::Animation* animation) override; 92 void AnimationProgressed(const gfx::Animation* animation) override;
93 void AnimationCanceled(const gfx::Animation* animation) override; 93 void AnimationCanceled(const gfx::Animation* animation) override;
94 94
95 private: 95 private:
96 friend class MessageCenterViewTest; 96 friend class MessageCenterViewTest;
97 97
98 enum class Mode { NOTIFICATIONS, SETTINGS, BUTTONS_ONLY };
99
98 void AddNotificationAt(const Notification& notification, int index); 100 void AddNotificationAt(const Notification& notification, int index);
99 void NotificationsChanged(); 101 void Update(bool animate);
102 void SetVisibilityMode(Mode mode, bool animate);
103 void UpdateButtonsStatus();
100 void SetNotificationViewForTest(MessageView* view); 104 void SetNotificationViewForTest(MessageView* view);
101 105
102 MessageCenter* message_center_; // Weak reference. 106 MessageCenter* message_center_; // Weak reference.
103 MessageCenterTray* tray_; // Weak reference. 107 MessageCenterTray* tray_; // Weak reference.
104 108
105 // Map notification_id->NotificationView*. It contains all NotificationViews 109 // Map notification_id->NotificationView*. It contains all NotificationViews
106 // currently displayed in MessageCenter. 110 // currently displayed in MessageCenter.
107 typedef std::map<std::string, NotificationView*> NotificationViewsMap; 111 typedef std::map<std::string, NotificationView*> NotificationViewsMap;
108 NotificationViewsMap notification_views_; // Weak. 112 NotificationViewsMap notification_views_; // Weak.
109 113
110 // Child views. 114 // Child views.
111 views::ScrollView* scroller_; 115 views::ScrollView* scroller_;
112 std::unique_ptr<MessageListView> message_list_view_; 116 std::unique_ptr<MessageListView> message_list_view_;
113 std::unique_ptr<views::View> empty_list_view_;
114 NotifierSettingsView* settings_view_; 117 NotifierSettingsView* settings_view_;
115 MessageCenterButtonBar* button_bar_; 118 MessageCenterButtonBar* button_bar_;
116 bool top_down_; 119 bool top_down_;
117 120
118 // Data for transition animation between settings view and message list. 121 // Data for transition animation between settings view and message list.
119 bool settings_visible_; 122 bool settings_visible_;
120 123
121 // Animation managing transition between message center and settings (and vice 124 // Animation managing transition between message center and settings (and vice
122 // versa). 125 // versa).
123 std::unique_ptr<gfx::MultiAnimation> settings_transition_animation_; 126 std::unique_ptr<gfx::MultiAnimation> settings_transition_animation_;
124 127
125 // Helper data to keep track of the transition between settings and 128 // Helper data to keep track of the transition between settings and
126 // message center views. 129 // message center views.
127 views::View* source_view_; 130 views::View* source_view_;
128 int source_height_; 131 int source_height_;
129 views::View* target_view_; 132 views::View* target_view_;
130 int target_height_; 133 int target_height_;
131 134
132 // True when the widget is closing so that further operations should be 135 // True when the widget is closing so that further operations should be
133 // ignored. 136 // ignored.
134 bool is_closing_; 137 bool is_closing_;
135 138
139 bool is_clearing_ = false;
140
141 // Current view mode. During animation, it is the target mode.
142 Mode mode_ = Mode::BUTTONS_ONLY;
143
136 std::unique_ptr<MessageViewContextMenuController> context_menu_controller_; 144 std::unique_ptr<MessageViewContextMenuController> context_menu_controller_;
137 145
138 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); 146 DISALLOW_COPY_AND_ASSIGN(MessageCenterView);
139 }; 147 };
140 148
141 } // namespace message_center 149 } // namespace message_center
142 150
143 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ 151 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698