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

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

Issue 20136004: Allow partial update for notification update API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add more tests per feedback Created 7 years, 5 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
« no previous file with comments | « chrome/renderer/resources/extensions/notifications_custom_bindings.js ('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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 Notification(const Notification& other); 63 Notification(const Notification& other);
64 Notification& operator=(const Notification& other); 64 Notification& operator=(const Notification& other);
65 virtual ~Notification(); 65 virtual ~Notification();
66 66
67 // Copies the internal on-memory state from |base|, i.e. shown_as_popup, 67 // Copies the internal on-memory state from |base|, i.e. shown_as_popup,
68 // is_read, is_expanded, and never_timeout. 68 // is_read, is_expanded, and never_timeout.
69 void CopyState(Notification* base); 69 void CopyState(Notification* base);
70 70
71 NotificationType type() const { return type_; } 71 NotificationType type() const { return type_; }
72 void set_type(NotificationType type) { type_ = type; }
73
72 const std::string& id() const { return id_; } 74 const std::string& id() const { return id_; }
75
73 const string16& title() const { return title_; } 76 const string16& title() const { return title_; }
77 void set_title(const string16& title) { title_ = title; }
78
74 const string16& message() const { return message_; } 79 const string16& message() const { return message_; }
80 void set_message(const string16& message) { message_ = message; }
75 81
76 // A display string for the source of the notification. 82 // A display string for the source of the notification.
77 const string16& display_source() const { return display_source_; } 83 const string16& display_source() const { return display_source_; }
78 const std::string& extension_id() const { return extension_id_; } 84 const std::string& extension_id() const { return extension_id_; }
79 void set_extension_id(const std::string& extension_id) { 85 void set_extension_id(const std::string& extension_id) {
80 extension_id_ = extension_id; 86 extension_id_ = extension_id;
81 } 87 }
82 88
83 // Begin unpacked values from optional_fields. 89 // Begin unpacked values from optional_fields.
84 int priority() const { return optional_fields_.priority; } 90 int priority() const { return optional_fields_.priority; }
91 void set_priority(int priority) { optional_fields_.priority = priority; }
92
85 base::Time timestamp() const { return optional_fields_.timestamp; } 93 base::Time timestamp() const { return optional_fields_.timestamp; }
94 void set_timestamp(const base::Time& timestamp) {
95 optional_fields_.timestamp = timestamp;
96 }
97
86 const string16& expanded_message() const { 98 const string16& expanded_message() const {
87 return optional_fields_.expanded_message; 99 return optional_fields_.expanded_message;
88 } 100 }
101 void set_expanded_message(const string16& expanded_message) {
102 optional_fields_.expanded_message = expanded_message;
103 }
104
89 const std::vector<NotificationItem>& items() const { 105 const std::vector<NotificationItem>& items() const {
90 return optional_fields_.items; 106 return optional_fields_.items;
91 } 107 }
108 void set_items(const std::vector<NotificationItem>& items) {
109 optional_fields_.items = items;
110 }
111
92 int progress() const { return optional_fields_.progress; } 112 int progress() const { return optional_fields_.progress; }
113 void set_progress(int progress) { optional_fields_.progress = progress; }
93 // End unpacked values. 114 // End unpacked values.
94 115
95 // Images fetched asynchronously. 116 // Images fetched asynchronously.
96 const gfx::Image& icon() const { return icon_; } 117 const gfx::Image& icon() const { return icon_; }
97 void set_icon(const gfx::Image& icon) { icon_ = icon; } 118 void set_icon(const gfx::Image& icon) { icon_ = icon; }
98 119
99 const gfx::Image& image() const { return optional_fields_.image; } 120 const gfx::Image& image() const { return optional_fields_.image; }
100 void set_image(const gfx::Image& image) { optional_fields_.image = image; } 121 void set_image(const gfx::Image& image) { optional_fields_.image = image; }
101 122
102 // Buttons, with icons fetched asynchronously. 123 // Buttons, with icons fetched asynchronously.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 bool is_expanded_; // True if this has been expanded in the message center. 191 bool is_expanded_; // True if this has been expanded in the message center.
171 192
172 // A proxy object that allows access back to the JavaScript object that 193 // A proxy object that allows access back to the JavaScript object that
173 // represents the notification, for firing events. 194 // represents the notification, for firing events.
174 scoped_refptr<NotificationDelegate> delegate_; 195 scoped_refptr<NotificationDelegate> delegate_;
175 }; 196 };
176 197
177 } // namespace message_center 198 } // namespace message_center
178 199
179 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ 200 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/notifications_custom_bindings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698