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 bool closable; |
56 std::vector<int> vibration_pattern; | 57 std::vector<int> vibration_pattern; |
57 bool silent; | 58 bool silent; |
58 }; | 59 }; |
59 | 60 |
60 class MESSAGE_CENTER_EXPORT Notification { | 61 class MESSAGE_CENTER_EXPORT Notification { |
61 public: | 62 public: |
62 Notification(NotificationType type, | 63 Notification(NotificationType type, |
63 const std::string& id, | 64 const std::string& id, |
64 const base::string16& title, | 65 const base::string16& title, |
65 const base::string16& message, | 66 const base::string16& message, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 bool never_timeout() const { return optional_fields_.never_timeout; } | 200 bool never_timeout() const { return optional_fields_.never_timeout; } |
200 void set_never_timeout(bool never_timeout) { | 201 void set_never_timeout(bool never_timeout) { |
201 optional_fields_.never_timeout = never_timeout; | 202 optional_fields_.never_timeout = never_timeout; |
202 } | 203 } |
203 | 204 |
204 bool clickable() const { return optional_fields_.clickable; } | 205 bool clickable() const { return optional_fields_.clickable; } |
205 void set_clickable(bool clickable) { | 206 void set_clickable(bool clickable) { |
206 optional_fields_.clickable = clickable; | 207 optional_fields_.clickable = clickable; |
207 } | 208 } |
208 | 209 |
| 210 bool closable() const { return optional_fields_.closable; } |
| 211 void set_closable(bool closable) { |
| 212 optional_fields_.closable = closable; |
| 213 } |
| 214 |
209 NotificationDelegate* delegate() const { return delegate_.get(); } | 215 NotificationDelegate* delegate() const { return delegate_.get(); } |
210 | 216 |
211 const RichNotificationData& rich_notification_data() const { | 217 const RichNotificationData& rich_notification_data() const { |
212 return optional_fields_; | 218 return optional_fields_; |
213 } | 219 } |
214 | 220 |
215 // Set the priority to SYSTEM. The system priority user needs to call this | 221 // Set the priority to SYSTEM. The system priority user needs to call this |
216 // method explicitly, to avoid setting it accidentally. | 222 // method explicitly, to avoid setting it accidentally. |
217 void SetSystemPriority(); | 223 void SetSystemPriority(); |
218 | 224 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 bool is_read_; // True if this has been seen in the message center. | 272 bool is_read_; // True if this has been seen in the message center. |
267 | 273 |
268 // A proxy object that allows access back to the JavaScript object that | 274 // A proxy object that allows access back to the JavaScript object that |
269 // represents the notification, for firing events. | 275 // represents the notification, for firing events. |
270 scoped_refptr<NotificationDelegate> delegate_; | 276 scoped_refptr<NotificationDelegate> delegate_; |
271 }; | 277 }; |
272 | 278 |
273 } // namespace message_center | 279 } // namespace message_center |
274 | 280 |
275 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ | 281 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ |
OLD | NEW |