OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |