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

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

Issue 344763002: Rename notification_id() to disambiguate its meaning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « chrome/browser/notifications/notification_test_util.cc ('k') | no next file » | 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) 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_NOTIFICATION_H_ 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_H_
6 #define UI_MESSAGE_CENTER_NOTIFICATION_H_ 6 #define UI_MESSAGE_CENTER_NOTIFICATION_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 Notification(NotificationType type, 57 Notification(NotificationType type,
58 const std::string& id, 58 const std::string& id,
59 const base::string16& title, 59 const base::string16& title,
60 const base::string16& message, 60 const base::string16& message,
61 const gfx::Image& icon, 61 const gfx::Image& icon,
62 const base::string16& display_source, 62 const base::string16& display_source,
63 const NotifierId& notifier_id, 63 const NotifierId& notifier_id,
64 const RichNotificationData& optional_fields, 64 const RichNotificationData& optional_fields,
65 NotificationDelegate* delegate); 65 NotificationDelegate* delegate);
66 66
67 virtual ~Notification();
dewittj 2014/06/19 17:01:23 The changes in this file seem separate from the re
juyik 2014/06/19 17:12:05 It was not a newly included. I just accidentally m
68
67 Notification(const Notification& other); 69 Notification(const Notification& other);
dewittj 2014/06/19 17:01:23 Could this be moved to protected as well?
juyik 2014/06/19 17:12:05 I have tried it and found that it was used by othe
68 70
69 Notification& operator=(const Notification& other);
70
71 virtual ~Notification();
72
73 // Copies the internal on-memory state from |base|, i.e. shown_as_popup, 71 // Copies the internal on-memory state from |base|, i.e. shown_as_popup,
74 // is_read, and never_timeout. 72 // is_read, and never_timeout.
75 void CopyState(Notification* base); 73 void CopyState(Notification* base);
76 74
77 NotificationType type() const { return type_; } 75 NotificationType type() const { return type_; }
78 void set_type(NotificationType type) { type_ = type; } 76 void set_type(NotificationType type) { type_ = type; }
79 77
80 // Uniquely identifies a notification in the message center. For 78 // Uniquely identifies a notification in the message center. For
81 // notification front ends that support multiple profiles, this id should 79 // notification front ends that support multiple profiles, this id should
82 // identify a unique profile + frontend_notification_id combination. You can 80 // identify a unique profile + frontend_notification_id combination. You can
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // will be invoked when the notification is clicked. 193 // will be invoked when the notification is clicked.
196 static scoped_ptr<Notification> CreateSystemNotification( 194 static scoped_ptr<Notification> CreateSystemNotification(
197 const std::string& notification_id, 195 const std::string& notification_id,
198 const base::string16& title, 196 const base::string16& title,
199 const base::string16& message, 197 const base::string16& message,
200 const gfx::Image& icon, 198 const gfx::Image& icon,
201 const std::string& system_component_id, 199 const std::string& system_component_id,
202 const base::Closure& click_callback); 200 const base::Closure& click_callback);
203 201
204 protected: 202 protected:
203 Notification& operator=(const Notification& other);
204
205 // The type of notification we'd like displayed. 205 // The type of notification we'd like displayed.
206 NotificationType type_; 206 NotificationType type_;
207 207
208 std::string id_; 208 std::string id_;
209 base::string16 title_; 209 base::string16 title_;
210 base::string16 message_; 210 base::string16 message_;
211 211
212 // Image data for the associated icon, used by Ash when available. 212 // Image data for the associated icon, used by Ash when available.
213 gfx::Image icon_; 213 gfx::Image icon_;
214 214
215 // The display string for the source of the notification. Could be 215 // The display string for the source of the notification. Could be
216 // the same as origin_url_, or the name of an extension. 216 // the same as origin_url_, or the name of an extension.
217 base::string16 display_source_; 217 base::string16 display_source_;
218 218
219 private: 219 private:
220 NotifierId notifier_id_; 220 NotifierId notifier_id_;
221 unsigned serial_number_; 221 unsigned serial_number_;
222 RichNotificationData optional_fields_; 222 RichNotificationData optional_fields_;
223 bool shown_as_popup_; // True if this has been shown as a popup. 223 bool shown_as_popup_; // True if this has been shown as a popup.
224 bool is_read_; // True if this has been seen in the message center. 224 bool is_read_; // True if this has been seen in the message center.
225 225
226 // A proxy object that allows access back to the JavaScript object that 226 // A proxy object that allows access back to the JavaScript object that
227 // represents the notification, for firing events. 227 // represents the notification, for firing events.
228 scoped_refptr<NotificationDelegate> delegate_; 228 scoped_refptr<NotificationDelegate> delegate_;
229 }; 229 };
230 230
231 } // namespace message_center 231 } // namespace message_center
232 232
233 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ 233 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698