OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 void show(); | 141 void show(); |
142 | 142 |
143 void setDir(const String& dir) { m_dir = dir; } | 143 void setDir(const String& dir) { m_dir = dir; } |
144 void setLang(const String& lang) { m_lang = lang; } | 144 void setLang(const String& lang) { m_lang = lang; } |
145 void setBody(const String& body) { m_body = body; } | 145 void setBody(const String& body) { m_body = body; } |
146 void setIconUrl(KURL iconUrl) { m_iconUrl = iconUrl; } | 146 void setIconUrl(KURL iconUrl) { m_iconUrl = iconUrl; } |
147 void setTag(const String& tag) { m_tag = tag; } | 147 void setTag(const String& tag) { m_tag = tag; } |
148 void setVibrate(const NavigatorVibration::VibrationPattern& vibrate) { m_vib
rate = vibrate; } | 148 void setVibrate(const NavigatorVibration::VibrationPattern& vibrate) { m_vib
rate = vibrate; } |
149 void setSilent(bool silent) { m_silent = silent; } | 149 void setSilent(bool silent) { m_silent = silent; } |
150 void setSerializedData(PassRefPtr<SerializedScriptValue> data) { m_serialize
dData = data; } | 150 void setSerializedData(PassRefPtr<SerializedScriptValue> data) { m_serialize
dData = data; } |
151 void setActions(const Vector<NotificationAction>& actions) { m_actions = act
ions; } | |
152 | 151 |
153 void setPersistentId(int64_t persistentId) { m_persistentId = persistentId;
} | 152 void setPersistentId(int64_t persistentId) { m_persistentId = persistentId;
} |
154 | 153 |
155 String m_title; | 154 String m_title; |
156 String m_dir; | 155 String m_dir; |
157 String m_lang; | 156 String m_lang; |
158 String m_body; | 157 String m_body; |
159 String m_tag; | 158 String m_tag; |
160 NavigatorVibration::VibrationPattern m_vibrate; | 159 NavigatorVibration::VibrationPattern m_vibrate; |
161 bool m_silent; | 160 bool m_silent; |
(...skipping 23 matching lines...) Expand all Loading... |
185 AsyncMethodRunner<Notification> m_asyncRunner; | 184 AsyncMethodRunner<Notification> m_asyncRunner; |
186 }; | 185 }; |
187 | 186 |
188 template<size_t C, typename A> | 187 template<size_t C, typename A> |
189 void Notification::actionsToWebActions(const Vector<NotificationAction, C, A>& a
ctions, WebVector<WebNotificationAction>& webActions) | 188 void Notification::actionsToWebActions(const Vector<NotificationAction, C, A>& a
ctions, WebVector<WebNotificationAction>& webActions) |
190 { | 189 { |
191 size_t count = std::min(+maxActions, actions.size()); | 190 size_t count = std::min(+maxActions, actions.size()); |
192 WebVector<WebNotificationAction> clearedAndResized(count); | 191 WebVector<WebNotificationAction> clearedAndResized(count); |
193 webActions.swap(clearedAndResized); | 192 webActions.swap(clearedAndResized); |
194 for (size_t i = 0; i < count; ++i) { | 193 for (size_t i = 0; i < count; ++i) { |
| 194 webActions[i].action = actions[i].action(); |
195 webActions[i].title = actions[i].title(); | 195 webActions[i].title = actions[i].title(); |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 } // namespace blink | 199 } // namespace blink |
200 | 200 |
201 #endif // Notification_h | 201 #endif // Notification_h |
OLD | NEW |