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

Side by Side Diff: ui/message_center/notification.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/message_center_impl_unittest.cc ('k') | ui/message_center/notification.cc » ('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) 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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 bool never_timeout; 46 bool never_timeout;
47 base::Time timestamp; 47 base::Time timestamp;
48 base::string16 context_message; 48 base::string16 context_message;
49 gfx::Image image; 49 gfx::Image image;
50 gfx::Image small_image; 50 gfx::Image small_image;
51 std::vector<NotificationItem> items; 51 std::vector<NotificationItem> items;
52 int progress; 52 int progress;
53 std::vector<ButtonInfo> buttons; 53 std::vector<ButtonInfo> buttons;
54 bool should_make_spoken_feedback_for_popup_updates; 54 bool should_make_spoken_feedback_for_popup_updates;
55 bool clickable; 55 bool clickable;
56 #if defined(OS_CHROMEOS)
57 // Flag if the notification is pinned. If true, the notification is pinned
58 // and user can't remove it.
59 bool pinned;
60 #endif // defined(OS_CHROMEOS)
56 std::vector<int> vibration_pattern; 61 std::vector<int> vibration_pattern;
57 bool renotify; 62 bool renotify;
58 bool silent; 63 bool silent;
59 }; 64 };
60 65
61 class MESSAGE_CENTER_EXPORT Notification { 66 class MESSAGE_CENTER_EXPORT Notification {
62 public: 67 public:
63 Notification(NotificationType type, 68 Notification(NotificationType type,
64 const std::string& id, 69 const std::string& id,
65 const base::string16& title, 70 const base::string16& title,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 bool never_timeout() const { return optional_fields_.never_timeout; } 211 bool never_timeout() const { return optional_fields_.never_timeout; }
207 void set_never_timeout(bool never_timeout) { 212 void set_never_timeout(bool never_timeout) {
208 optional_fields_.never_timeout = never_timeout; 213 optional_fields_.never_timeout = never_timeout;
209 } 214 }
210 215
211 bool clickable() const { return optional_fields_.clickable; } 216 bool clickable() const { return optional_fields_.clickable; }
212 void set_clickable(bool clickable) { 217 void set_clickable(bool clickable) {
213 optional_fields_.clickable = clickable; 218 optional_fields_.clickable = clickable;
214 } 219 }
215 220
221 bool pinned() const {
222 #if defined(OS_CHROMEOS)
223 return optional_fields_.pinned;
224 #else
225 return false;
226 #endif // defined(OS_CHROMEOS)
227 }
228 #if defined(OS_CHROMEOS)
229 void set_pinned(bool pinned) { optional_fields_.pinned = pinned; }
230 #endif // defined(OS_CHROMEOS)
231
216 NotificationDelegate* delegate() const { return delegate_.get(); } 232 NotificationDelegate* delegate() const { return delegate_.get(); }
217 233
218 const RichNotificationData& rich_notification_data() const { 234 const RichNotificationData& rich_notification_data() const {
219 return optional_fields_; 235 return optional_fields_;
220 } 236 }
221 237
222 // Set the priority to SYSTEM. The system priority user needs to call this 238 // Set the priority to SYSTEM. The system priority user needs to call this
223 // method explicitly, to avoid setting it accidentally. 239 // method explicitly, to avoid setting it accidentally.
224 void SetSystemPriority(); 240 void SetSystemPriority();
225 241
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 bool is_read_; // True if this has been seen in the message center. 289 bool is_read_; // True if this has been seen in the message center.
274 290
275 // A proxy object that allows access back to the JavaScript object that 291 // A proxy object that allows access back to the JavaScript object that
276 // represents the notification, for firing events. 292 // represents the notification, for firing events.
277 scoped_refptr<NotificationDelegate> delegate_; 293 scoped_refptr<NotificationDelegate> delegate_;
278 }; 294 };
279 295
280 } // namespace message_center 296 } // namespace message_center
281 297
282 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ 298 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_
OLDNEW
« no previous file with comments | « ui/message_center/message_center_impl_unittest.cc ('k') | ui/message_center/notification.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698