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

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

Issue 15582004: Move NotificationDelegate into message_center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copy delegate in notification update too. Created 7 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) 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 <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // Basic operations of notification: add/remove/update. 88 // Basic operations of notification: add/remove/update.
89 89
90 // Adds a new notification. |id| is a unique identifier, used to update or 90 // Adds a new notification. |id| is a unique identifier, used to update or
91 // remove notifications. |title| and |meesage| describe the notification text. 91 // remove notifications. |title| and |meesage| describe the notification text.
92 // Use SetNotificationIcon, SetNotificationImage, or SetNotificationButtonIcon 92 // Use SetNotificationIcon, SetNotificationImage, or SetNotificationButtonIcon
93 // to set images. If |extension_id| is provided then 'Disable extension' will 93 // to set images. If |extension_id| is provided then 'Disable extension' will
94 // appear in a dropdown menu and the id will be used to disable notifications 94 // appear in a dropdown menu and the id will be used to disable notifications
95 // from the extension. Otherwise if |display_source| is provided, a menu item 95 // from the extension. Otherwise if |display_source| is provided, a menu item
96 // showing the source and allowing notifications from that source to be 96 // showing the source and allowing notifications from that source to be
97 // disabled will be shown. All actual disabling is handled by the Delegate. 97 // disabled will be shown. All actual disabling is handled by the Delegate.
98 virtual void AddNotification( 98 virtual void AddNotification(NotificationType type,
99 NotificationType type, 99 const std::string& id,
100 const std::string& id, 100 const string16& title,
101 const string16& title, 101 const string16& message,
102 const string16& message, 102 const string16& display_source,
103 const string16& display_source, 103 const std::string& extension_id,
104 const std::string& extension_id, 104 const base::DictionaryValue* optional_fields,
105 const base::DictionaryValue* optional_fields) = 0; 105 NotificationDelegate* delegate) = 0;
106 106
107 // Updates an existing notification with id = old_id and set its id to new_id. 107 // Updates an existing notification with id = old_id and set its id to new_id.
108 // |optional_fields| can be NULL in case of no updates on those fields. 108 // |delegate| and |optional_fields| can be NULL in case of no updates on
109 virtual void UpdateNotification( 109 // those fields.
110 const std::string& old_id, 110 virtual void UpdateNotification(const std::string& old_id,
111 const std::string& new_id, 111 const std::string& new_id,
112 const string16& title, 112 const string16& title,
113 const string16& message, 113 const string16& message,
114 const base::DictionaryValue* optional_fields) = 0; 114 const base::DictionaryValue* optional_fields,
115 NotificationDelegate* delegate) = 0;
115 116
116 // Removes an existing notification. 117 // Removes an existing notification.
117 virtual void RemoveNotification(const std::string& id, bool by_user) = 0; 118 virtual void RemoveNotification(const std::string& id, bool by_user) = 0;
118 virtual void RemoveAllNotifications(bool by_user) = 0; 119 virtual void RemoveAllNotifications(bool by_user) = 0;
119 120
120 // Sets the icon image. Icon appears at the top-left of the notification. 121 // Sets the icon image. Icon appears at the top-left of the notification.
121 virtual void SetNotificationIcon(const std::string& notification_id, 122 virtual void SetNotificationIcon(const std::string& notification_id,
122 const gfx::Image& image) = 0; 123 const gfx::Image& image) = 0;
123 124
124 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified 125 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified
(...skipping 30 matching lines...) Expand all
155 MessageCenter(); 156 MessageCenter();
156 virtual ~MessageCenter(); 157 virtual ~MessageCenter();
157 158
158 private: 159 private:
159 DISALLOW_COPY_AND_ASSIGN(MessageCenter); 160 DISALLOW_COPY_AND_ASSIGN(MessageCenter);
160 }; 161 };
161 162
162 } // namespace message_center 163 } // namespace message_center
163 164
164 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ 165 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698