OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "modules/notifications/NotificationData.h" | 5 #include "modules/notifications/NotificationData.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/SerializedScriptValue.h" | 8 #include "bindings/core/v8/SerializedScriptValue.h" |
9 #include "bindings/core/v8/SerializedScriptValueFactory.h" | 9 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 WebNotificationData webData; | 54 WebNotificationData webData; |
55 | 55 |
56 webData.title = title; | 56 webData.title = title; |
57 webData.direction = toDirectionEnumValue(options.dir()); | 57 webData.direction = toDirectionEnumValue(options.dir()); |
58 webData.lang = options.lang(); | 58 webData.lang = options.lang(); |
59 webData.body = options.body(); | 59 webData.body = options.body(); |
60 webData.tag = options.tag(); | 60 webData.tag = options.tag(); |
61 | 61 |
| 62 if (options.hasImage() && !options.image().isEmpty()) |
| 63 webData.image = completeURL(executionContext, options.image()); |
| 64 |
62 if (options.hasIcon() && !options.icon().isEmpty()) | 65 if (options.hasIcon() && !options.icon().isEmpty()) |
63 webData.icon = completeURL(executionContext, options.icon()); | 66 webData.icon = completeURL(executionContext, options.icon()); |
64 | 67 |
65 if (options.hasBadge() && !options.badge().isEmpty()) | 68 if (options.hasBadge() && !options.badge().isEmpty()) |
66 webData.badge = completeURL(executionContext, options.badge()); | 69 webData.badge = completeURL(executionContext, options.badge()); |
67 | 70 |
68 webData.vibrate = VibrationController::sanitizeVibrationPattern(options.vibr
ate()); | 71 webData.vibrate = VibrationController::sanitizeVibrationPattern(options.vibr
ate()); |
69 webData.timestamp = options.hasTimestamp() ? static_cast<double>(options.tim
estamp()) : WTF::currentTimeMS(); | 72 webData.timestamp = options.hasTimestamp() ? static_cast<double>(options.tim
estamp()) : WTF::currentTimeMS(); |
70 webData.renotify = options.renotify(); | 73 webData.renotify = options.renotify(); |
71 webData.silent = options.silent(); | 74 webData.silent = options.silent(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 118 |
116 actions.append(webAction); | 119 actions.append(webAction); |
117 } | 120 } |
118 | 121 |
119 webData.actions = actions; | 122 webData.actions = actions; |
120 | 123 |
121 return webData; | 124 return webData; |
122 } | 125 } |
123 | 126 |
124 } // namespace blink | 127 } // namespace blink |
OLD | NEW |