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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 bool never_timeout; | 43 bool never_timeout; |
44 base::Time timestamp; | 44 base::Time timestamp; |
45 base::string16 context_message; | 45 base::string16 context_message; |
46 gfx::Image image; | 46 gfx::Image image; |
47 gfx::Image small_image; | 47 gfx::Image small_image; |
48 std::vector<NotificationItem> items; | 48 std::vector<NotificationItem> items; |
49 int progress; | 49 int progress; |
50 std::vector<ButtonInfo> buttons; | 50 std::vector<ButtonInfo> buttons; |
51 bool should_make_spoken_feedback_for_popup_updates; | 51 bool should_make_spoken_feedback_for_popup_updates; |
52 bool clickable; | 52 bool clickable; |
| 53 std::vector<int> vibration_pattern; |
53 bool silent; | 54 bool silent; |
54 }; | 55 }; |
55 | 56 |
56 class MESSAGE_CENTER_EXPORT Notification { | 57 class MESSAGE_CENTER_EXPORT Notification { |
57 public: | 58 public: |
58 Notification(NotificationType type, | 59 Notification(NotificationType type, |
59 const std::string& id, | 60 const std::string& id, |
60 const base::string16& title, | 61 const base::string16& title, |
61 const base::string16& message, | 62 const base::string16& message, |
62 const gfx::Image& icon, | 63 const gfx::Image& icon, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 const NotifierId& notifier_id() const { return notifier_id_; } | 98 const NotifierId& notifier_id() const { return notifier_id_; } |
98 | 99 |
99 void set_profile_id(const std::string& profile_id) { | 100 void set_profile_id(const std::string& profile_id) { |
100 notifier_id_.profile_id = profile_id; | 101 notifier_id_.profile_id = profile_id; |
101 } | 102 } |
102 | 103 |
103 // Begin unpacked values from optional_fields. | 104 // Begin unpacked values from optional_fields. |
104 int priority() const { return optional_fields_.priority; } | 105 int priority() const { return optional_fields_.priority; } |
105 void set_priority(int priority) { optional_fields_.priority = priority; } | 106 void set_priority(int priority) { optional_fields_.priority = priority; } |
106 | 107 |
| 108 // This vibration_pattern property currently has no effect on |
| 109 // non-Android platforms. |
| 110 const std::vector<int>& vibration_pattern() const { |
| 111 return optional_fields_.vibration_pattern; |
| 112 } |
| 113 void set_vibration_pattern(const std::vector<int>& vibration_pattern) { |
| 114 optional_fields_.vibration_pattern = vibration_pattern; |
| 115 } |
| 116 |
107 // This property currently has no effect on non-Android platforms. | 117 // This property currently has no effect on non-Android platforms. |
108 bool silent() const { return optional_fields_.silent; } | 118 bool silent() const { return optional_fields_.silent; } |
109 void set_silent(bool silent) { optional_fields_.silent = silent; } | 119 void set_silent(bool silent) { optional_fields_.silent = silent; } |
110 | 120 |
111 base::Time timestamp() const { return optional_fields_.timestamp; } | 121 base::Time timestamp() const { return optional_fields_.timestamp; } |
112 void set_timestamp(const base::Time& timestamp) { | 122 void set_timestamp(const base::Time& timestamp) { |
113 optional_fields_.timestamp = timestamp; | 123 optional_fields_.timestamp = timestamp; |
114 } | 124 } |
115 | 125 |
116 const base::string16& context_message() const { | 126 const base::string16& context_message() const { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 bool is_read_; // True if this has been seen in the message center. | 240 bool is_read_; // True if this has been seen in the message center. |
231 | 241 |
232 // A proxy object that allows access back to the JavaScript object that | 242 // A proxy object that allows access back to the JavaScript object that |
233 // represents the notification, for firing events. | 243 // represents the notification, for firing events. |
234 scoped_refptr<NotificationDelegate> delegate_; | 244 scoped_refptr<NotificationDelegate> delegate_; |
235 }; | 245 }; |
236 | 246 |
237 } // namespace message_center | 247 } // namespace message_center |
238 | 248 |
239 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ | 249 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ |
OLD | NEW |