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

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

Issue 1645843003: Implement Non-Closable Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary property. Created 4 years, 10 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
« no previous file with comments | « ui/message_center/fake_message_center.cc ('k') | ui/message_center/message_center_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MESSAGE_CENTER_H_ 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_H_
6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class MessagePopupCollectionTest; 43 class MessagePopupCollectionTest;
44 } 44 }
45 45
46 class MessageCenterObserver; 46 class MessageCenterObserver;
47 class MessageCenterImplTest; 47 class MessageCenterImplTest;
48 class NotificationBlocker; 48 class NotificationBlocker;
49 class NotifierSettingsProvider; 49 class NotifierSettingsProvider;
50 50
51 class MESSAGE_CENTER_EXPORT MessageCenter { 51 class MESSAGE_CENTER_EXPORT MessageCenter {
52 public: 52 public:
53 enum class RemoveType {
54 // Remove all notifications.
55 ALL,
56 // Remove non-pinned notification (don't remove invisible ones).
57 NON_PINNED,
58 };
59
53 // Creates the global message center object. 60 // Creates the global message center object.
54 static void Initialize(); 61 static void Initialize();
55 62
56 // Returns the global message center object. Returns NULL if Initialize is not 63 // Returns the global message center object. Returns NULL if Initialize is not
57 // called. 64 // called.
58 static MessageCenter* Get(); 65 static MessageCenter* Get();
59 66
60 // Destroys the global message_center object. 67 // Destroys the global message_center object.
61 static void Shutdown(); 68 static void Shutdown();
62 69
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // Adds a new notification. 102 // Adds a new notification.
96 virtual void AddNotification(scoped_ptr<Notification> notification) = 0; 103 virtual void AddNotification(scoped_ptr<Notification> notification) = 0;
97 104
98 // Updates an existing notification with id = old_id and set its id to new_id. 105 // Updates an existing notification with id = old_id and set its id to new_id.
99 virtual void UpdateNotification( 106 virtual void UpdateNotification(
100 const std::string& old_id, 107 const std::string& old_id,
101 scoped_ptr<Notification> new_notification) = 0; 108 scoped_ptr<Notification> new_notification) = 0;
102 109
103 // Removes an existing notification. 110 // Removes an existing notification.
104 virtual void RemoveNotification(const std::string& id, bool by_user) = 0; 111 virtual void RemoveNotification(const std::string& id, bool by_user) = 0;
105 virtual void RemoveAllNotifications(bool by_user) = 0; 112 virtual void RemoveAllNotifications(bool by_user, RemoveType type) = 0;
106 virtual void RemoveAllVisibleNotifications(bool by_user) = 0;
107 113
108 // Sets the icon image. Icon appears at the top-left of the notification. 114 // Sets the icon image. Icon appears at the top-left of the notification.
109 virtual void SetNotificationIcon(const std::string& notification_id, 115 virtual void SetNotificationIcon(const std::string& notification_id,
110 const gfx::Image& image) = 0; 116 const gfx::Image& image) = 0;
111 117
112 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified 118 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified
113 // image will appear below of the notification. 119 // image will appear below of the notification.
114 virtual void SetNotificationImage(const std::string& notification_id, 120 virtual void SetNotificationImage(const std::string& notification_id,
115 const gfx::Image& image) = 0; 121 const gfx::Image& image) = 0;
116 122
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // Note carefully: this may break the layout of message center. Shouldn't use 211 // Note carefully: this may break the layout of message center. Shouldn't use
206 // this method if the update changes its notification size. 212 // this method if the update changes its notification size.
207 virtual void ForceNotificationFlush(const std::string& id) {} 213 virtual void ForceNotificationFlush(const std::string& id) {}
208 214
209 DISALLOW_COPY_AND_ASSIGN(MessageCenter); 215 DISALLOW_COPY_AND_ASSIGN(MessageCenter);
210 }; 216 };
211 217
212 } // namespace message_center 218 } // namespace message_center
213 219
214 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ 220 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_
OLDNEW
« no previous file with comments | « ui/message_center/fake_message_center.cc ('k') | ui/message_center/message_center_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698