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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 std::vector<int> vibration_pattern; | 56 std::vector<int> vibration_pattern; |
| 57 bool renotify; |
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, |
66 const gfx::Image& icon, | 67 const gfx::Image& icon, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // This vibration_pattern property currently has no effect on | 118 // This vibration_pattern property currently has no effect on |
118 // non-Android platforms. | 119 // non-Android platforms. |
119 const std::vector<int>& vibration_pattern() const { | 120 const std::vector<int>& vibration_pattern() const { |
120 return optional_fields_.vibration_pattern; | 121 return optional_fields_.vibration_pattern; |
121 } | 122 } |
122 void set_vibration_pattern(const std::vector<int>& vibration_pattern) { | 123 void set_vibration_pattern(const std::vector<int>& vibration_pattern) { |
123 optional_fields_.vibration_pattern = vibration_pattern; | 124 optional_fields_.vibration_pattern = vibration_pattern; |
124 } | 125 } |
125 | 126 |
126 // This property currently has no effect on non-Android platforms. | 127 // This property currently has no effect on non-Android platforms. |
| 128 // It determines whether the sound and vibration effects should signal |
| 129 // if the notification is replacing another notification. |
| 130 bool renotify() const { return optional_fields_.renotify; } |
| 131 void set_renotify(bool renotify) { optional_fields_.renotify = renotify; } |
| 132 |
| 133 // This property currently has no effect on non-Android platforms. |
127 bool silent() const { return optional_fields_.silent; } | 134 bool silent() const { return optional_fields_.silent; } |
128 void set_silent(bool silent) { optional_fields_.silent = silent; } | 135 void set_silent(bool silent) { optional_fields_.silent = silent; } |
129 | 136 |
130 base::Time timestamp() const { return optional_fields_.timestamp; } | 137 base::Time timestamp() const { return optional_fields_.timestamp; } |
131 void set_timestamp(const base::Time& timestamp) { | 138 void set_timestamp(const base::Time& timestamp) { |
132 optional_fields_.timestamp = timestamp; | 139 optional_fields_.timestamp = timestamp; |
133 } | 140 } |
134 | 141 |
135 const base::string16 context_message() const { | 142 const base::string16 context_message() const { |
136 return optional_fields_.context_message; | 143 return optional_fields_.context_message; |
(...skipping 129 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. | 273 bool is_read_; // True if this has been seen in the message center. |
267 | 274 |
268 // A proxy object that allows access back to the JavaScript object that | 275 // A proxy object that allows access back to the JavaScript object that |
269 // represents the notification, for firing events. | 276 // represents the notification, for firing events. |
270 scoped_refptr<NotificationDelegate> delegate_; | 277 scoped_refptr<NotificationDelegate> delegate_; |
271 }; | 278 }; |
272 | 279 |
273 } // namespace message_center | 280 } // namespace message_center |
274 | 281 |
275 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ | 282 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ |
OLD | NEW |