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

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

Issue 11410008: Created initial multi-item notification view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « ui/message_center/message_view_multiple.cc ('k') | ui/notifications/notification_types.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_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 <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "ui/gfx/image/image_skia.h" 13 #include "ui/gfx/image/image_skia.h"
14 #include "ui/message_center/message_center_export.h" 14 #include "ui/message_center/message_center_export.h"
15 #include "ui/notifications/notification_types.h" 15 #include "ui/notifications/notification_types.h"
16 16
17 namespace base { 17 namespace base {
18 class DictionaryValue; 18 class DictionaryValue;
19 } 19 }
20 20
21 namespace message_center { 21 namespace message_center {
22 22
23 // A helper class to manage the list of notifications. 23 // A helper class to manage the list of notifications.
24 class MESSAGE_CENTER_EXPORT NotificationList { 24 class MESSAGE_CENTER_EXPORT NotificationList {
25 public: 25 public:
26 struct MESSAGE_CENTER_EXPORT NotificationItem {
27 string16 title;
28 string16 message;
29 NotificationItem(string16 title, string16 message)
30 : title(title),
31 message(message) {}
32 };
33
26 struct MESSAGE_CENTER_EXPORT Notification { 34 struct MESSAGE_CENTER_EXPORT Notification {
27 Notification(); 35 Notification();
28 virtual ~Notification(); 36 virtual ~Notification();
29 37
30 ui::notifications::NotificationType type; 38 ui::notifications::NotificationType type;
31 std::string id; 39 std::string id;
32 string16 title; 40 string16 title;
33 string16 message; 41 string16 message;
34 string16 display_source; 42 string16 display_source;
35 std::string extension_id; 43 std::string extension_id;
36 44
37 // Begin unpacked values from optional_fields 45 // Begin unpacked values from optional_fields
38 string16 message_intent; 46 string16 message_intent;
39 int priority; 47 int priority;
40 base::Time timestamp; 48 base::Time timestamp;
41 gfx::ImageSkia second_image; 49 gfx::ImageSkia second_image;
42 int unread_count; 50 int unread_count;
43 string16 button_one_title; 51 string16 button_one_title;
44 string16 button_one_intent; 52 string16 button_one_intent;
45 string16 button_two_title; 53 string16 button_two_title;
46 string16 button_two_intent; 54 string16 button_two_intent;
47 string16 expanded_message; 55 string16 expanded_message;
48 string16 image_url; 56 string16 image_url;
57 std::vector<NotificationItem>* items;
miket_OOO 2012/11/20 23:54:52 Sorry, I must have missed this earlier. I'm not se
49 // End unpacked values 58 // End unpacked values
50 59
51 gfx::ImageSkia image; 60 gfx::ImageSkia image;
52 bool is_read; // True if this has been seen in the message center 61 bool is_read; // True if this has been seen in the message center
53 bool shown_as_popup; // True if this has been shown as a popup notification 62 bool shown_as_popup; // True if this has been shown as a popup notification
54 }; 63 };
55 64
56 typedef std::list<Notification> Notifications; 65 typedef std::list<Notification> Notifications;
57 66
58 class MESSAGE_CENTER_EXPORT Delegate { 67 class MESSAGE_CENTER_EXPORT Delegate {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 Notifications notifications_; 163 Notifications notifications_;
155 bool message_center_visible_; 164 bool message_center_visible_;
156 size_t unread_count_; 165 size_t unread_count_;
157 166
158 DISALLOW_COPY_AND_ASSIGN(NotificationList); 167 DISALLOW_COPY_AND_ASSIGN(NotificationList);
159 }; 168 };
160 169
161 } // namespace message_center 170 } // namespace message_center
162 171
163 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ 172 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
OLDNEW
« no previous file with comments | « ui/message_center/message_view_multiple.cc ('k') | ui/notifications/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698