OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebNotificationData_h | 5 #ifndef WebNotificationData_h |
6 #define WebNotificationData_h | 6 #define WebNotificationData_h |
7 | 7 |
8 #include "public/platform/WebString.h" | 8 #include "public/platform/WebString.h" |
9 #include "public/platform/WebURL.h" | 9 #include "public/platform/WebURL.h" |
10 #include "public/platform/WebVector.h" | 10 #include "public/platform/WebVector.h" |
| 11 #include "public/platform/modules/notifications/WebNotificationAction.h" |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 // Structure representing the data associated with a Web Notification. | 15 // Structure representing the data associated with a Web Notification. |
15 struct WebNotificationData { | 16 struct WebNotificationData { |
16 enum Direction { | 17 enum Direction { |
17 DirectionLeftToRight, | 18 DirectionLeftToRight, |
18 DirectionRightToLeft | 19 DirectionRightToLeft |
19 }; | 20 }; |
20 | 21 |
21 WebNotificationData() | 22 WebNotificationData() |
22 : direction(DirectionLeftToRight) | 23 : direction(DirectionLeftToRight) |
23 , silent(false) | 24 , silent(false) |
24 { | 25 { |
25 } | 26 } |
26 | 27 |
| 28 // FIXME: Remove this constructor when Chromium has switched to the new one. |
27 WebNotificationData(const WebString& title, Direction direction, const WebSt
ring& lang, const WebString& body, const WebString& tag, const WebURL& icon, con
st WebVector<int>& vibrate, bool silent, const WebVector<char>& data) | 29 WebNotificationData(const WebString& title, Direction direction, const WebSt
ring& lang, const WebString& body, const WebString& tag, const WebURL& icon, con
st WebVector<int>& vibrate, bool silent, const WebVector<char>& data) |
28 : title(title) | 30 : title(title) |
29 , direction(direction) | 31 , direction(direction) |
30 , lang(lang) | 32 , lang(lang) |
31 , body(body) | 33 , body(body) |
32 , tag(tag) | 34 , tag(tag) |
33 , icon(icon) | 35 , icon(icon) |
34 , vibrate(vibrate) | 36 , vibrate(vibrate) |
35 , silent(silent) | 37 , silent(silent) |
36 , data(data) | 38 , data(data) |
37 { | 39 { |
38 } | 40 } |
39 | 41 |
| 42 WebNotificationData(const WebString& title, Direction direction, const WebSt
ring& lang, const WebString& body, const WebString& tag, const WebURL& icon, con
st WebVector<int>& vibrate, bool silent, const WebVector<char>& data, const WebV
ector<WebNotificationAction>& actions) |
| 43 : title(title) |
| 44 , direction(direction) |
| 45 , lang(lang) |
| 46 , body(body) |
| 47 , tag(tag) |
| 48 , icon(icon) |
| 49 , vibrate(vibrate) |
| 50 , silent(silent) |
| 51 , data(data) |
| 52 , actions(actions) |
| 53 { |
| 54 } |
| 55 |
40 WebString title; | 56 WebString title; |
41 Direction direction; | 57 Direction direction; |
42 WebString lang; | 58 WebString lang; |
43 WebString body; | 59 WebString body; |
44 WebString tag; | 60 WebString tag; |
45 WebURL icon; | 61 WebURL icon; |
46 WebVector<int> vibrate; | 62 WebVector<int> vibrate; |
47 bool silent; | 63 bool silent; |
48 WebVector<char> data; | 64 WebVector<char> data; |
| 65 WebVector<WebNotificationAction> actions; |
49 }; | 66 }; |
50 | 67 |
51 } // namespace blink | 68 } // namespace blink |
52 | 69 |
53 #endif // WebNotificationData_h | 70 #endif // WebNotificationData_h |
OLD | NEW |