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

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

Issue 12326091: Made notification center notifications collapsed and expandable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased, which led to many changes. Created 7 years, 9 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_LIST_H_ 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
6 #define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ 6 #define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // Requests the Delegate to show the settings page. 60 // Requests the Delegate to show the settings page.
61 virtual void ShowNotificationSettings(const std::string& id) = 0; 61 virtual void ShowNotificationSettings(const std::string& id) = 0;
62 62
63 // Requests the Delegate to show the settings dialog. 63 // Requests the Delegate to show the settings dialog.
64 virtual void ShowNotificationSettingsDialog(gfx::NativeView context) = 0; 64 virtual void ShowNotificationSettingsDialog(gfx::NativeView context) = 0;
65 65
66 // Called when a notification is clicked on. 66 // Called when a notification is clicked on.
67 virtual void OnNotificationClicked(const std::string& id) = 0; 67 virtual void OnNotificationClicked(const std::string& id) = 0;
68 68
69 // Called when the quiet mode status has been changed.
70 virtual void OnQuietModeChanged(bool quiet_mode) = 0;
71
72 // Called when a button in a notification is clicked. |button_index| 69 // Called when a button in a notification is clicked. |button_index|
73 // indicates which button was clicked, zero-indexed (button one is 0, 70 // indicates which button was clicked, zero-indexed (button one is 0,
74 // button two is 1). 71 // button two is 1).
75 virtual void OnButtonClicked(const std::string& id, int button_index) = 0; 72 virtual void OnButtonClicked(const std::string& id, int button_index) = 0;
76 73
77 // Returns the list of notifications to display. 74 // Called when a notification has been expanded in the notification center.
78 virtual NotificationList* GetNotificationList() = 0; 75 virtual void OnExpand(const std::string& id) = 0;
76
77 // Called when the quiet mode status has been changed.
78 virtual void OnQuietModeChanged(bool quiet_mode) = 0;
dharcourt 2013/03/01 10:17:31 GetNotificationList() was removed because it cause
79 }; 79 };
80 80
81 explicit NotificationList(Delegate* delegate); 81 explicit NotificationList(Delegate* delegate);
82 virtual ~NotificationList(); 82 virtual ~NotificationList();
83 83
84 // Affects whether or not a message has been "read". 84 // Affects whether or not a message has been "read".
85 void SetMessageCenterVisible(bool visible); 85 void SetMessageCenterVisible(bool visible);
86 86
87 void AddNotification(NotificationType type, 87 void AddNotification(NotificationType type,
88 const std::string& id, 88 const std::string& id,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 PopupNotifications GetPopupNotifications(); 132 PopupNotifications GetPopupNotifications();
133 133
134 // Marks the popups for the |priority| as shown. 134 // Marks the popups for the |priority| as shown.
135 void MarkPopupsAsShown(int priority); 135 void MarkPopupsAsShown(int priority);
136 136
137 // Marks a specific popup item as shown. Set |mark_notification_as_read| to 137 // Marks a specific popup item as shown. Set |mark_notification_as_read| to
138 // true in case marking the notification as read too. 138 // true in case marking the notification as read too.
139 void MarkSinglePopupAsShown(const std::string& id, 139 void MarkSinglePopupAsShown(const std::string& id,
140 bool mark_notification_as_read); 140 bool mark_notification_as_read);
141 141
142 // Marks the specified notification as expanded in the notification center.
143 void MarkNotificationAsExpanded(const std::string& id);
144
142 bool quiet_mode() const { return quiet_mode_; } 145 bool quiet_mode() const { return quiet_mode_; }
143 146
144 // Sets the current quiet mode status to |quiet_mode|. The new status is not 147 // Sets the current quiet mode status to |quiet_mode|. The new status is not
145 // expired. 148 // expired.
146 void SetQuietMode(bool quiet_mode); 149 void SetQuietMode(bool quiet_mode);
147 150
148 // Sets the current quiet mode to true. The quiet mode will expire in the 151 // Sets the current quiet mode to true. The quiet mode will expire in the
149 // specified time-delta from now. 152 // specified time-delta from now.
150 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in); 153 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in);
151 154
(...skipping 23 matching lines...) Expand all
175 size_t unread_count_; 178 size_t unread_count_;
176 bool quiet_mode_; 179 bool quiet_mode_;
177 scoped_ptr<base::OneShotTimer<NotificationList> > quiet_mode_timer_; 180 scoped_ptr<base::OneShotTimer<NotificationList> > quiet_mode_timer_;
178 181
179 DISALLOW_COPY_AND_ASSIGN(NotificationList); 182 DISALLOW_COPY_AND_ASSIGN(NotificationList);
180 }; 183 };
181 184
182 } // namespace message_center 185 } // namespace message_center
183 186
184 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ 187 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698