Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: public/platform/modules/notifications/WebNotificationData.h

Issue 1259193003: Add priority to Notification & NotificationOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@actions3
Patch Set: Lowest to highest enum order Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "public/platform/modules/notifications/WebNotificationAction.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 // Structure representing the data associated with a Web Notification. 15 // Structure representing the data associated with a Web Notification.
16 struct WebNotificationData { 16 struct WebNotificationData {
17 enum Direction { 17 enum Direction {
18 DirectionLeftToRight, 18 DirectionLeftToRight,
19 DirectionRightToLeft 19 DirectionRightToLeft
20 }; 20 };
21 21
22 enum Priority {
23 PriorityLowest,
24 PriorityLow,
25 PriorityNormal,
26 PriorityHigh,
27 PriorityHighest
28 };
29
22 WebNotificationData() 30 WebNotificationData()
23 : direction(DirectionLeftToRight) 31 : direction(DirectionLeftToRight)
32 , priority(PriorityNormal)
24 , silent(false) 33 , silent(false)
25 { 34 {
26 } 35 }
27 36
28 // FIXME: Remove this constructor when Chromium has switched to the new one. 37 // FIXME: Remove this constructor when Chromium has switched to the new one.
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) 38 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)
30 : title(title) 39 : title(title)
31 , direction(direction) 40 , direction(direction)
32 , lang(lang) 41 , lang(lang)
33 , body(body) 42 , body(body)
34 , tag(tag) 43 , tag(tag)
44 , priority(PriorityNormal)
35 , icon(icon) 45 , icon(icon)
36 , vibrate(vibrate) 46 , vibrate(vibrate)
37 , silent(silent) 47 , silent(silent)
38 , data(data) 48 , data(data)
39 { 49 {
40 } 50 }
41 51
52 // TODO(johnme): Remove this constructor when Chromium has switched to the n ew one.
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) 53 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) 54 : title(title)
44 , direction(direction) 55 , direction(direction)
45 , lang(lang) 56 , lang(lang)
46 , body(body) 57 , body(body)
47 , tag(tag) 58 , tag(tag)
59 , priority(PriorityNormal)
48 , icon(icon) 60 , icon(icon)
49 , vibrate(vibrate) 61 , vibrate(vibrate)
50 , silent(silent) 62 , silent(silent)
63 , data(data)
64 , actions(actions)
65 {
66 }
67
68 WebNotificationData(const WebString& title, Direction direction, const WebSt ring& lang, const WebString& body, const WebString& tag, Priority priority, cons t WebURL& icon, const WebVector<int>& vibrate, bool silent, const WebVector<char >& data, const WebVector<WebNotificationAction>& actions)
69 : title(title)
70 , direction(direction)
71 , lang(lang)
72 , body(body)
73 , tag(tag)
74 , priority(priority)
75 , icon(icon)
76 , vibrate(vibrate)
77 , silent(silent)
51 , data(data) 78 , data(data)
52 , actions(actions) 79 , actions(actions)
53 { 80 {
54 } 81 }
55 82
56 WebString title; 83 WebString title;
57 Direction direction; 84 Direction direction;
58 WebString lang; 85 WebString lang;
59 WebString body; 86 WebString body;
60 WebString tag; 87 WebString tag;
88 Priority priority;
61 WebURL icon; 89 WebURL icon;
62 WebVector<int> vibrate; 90 WebVector<int> vibrate;
63 bool silent; 91 bool silent;
64 WebVector<char> data; 92 WebVector<char> data;
65 WebVector<WebNotificationAction> actions; 93 WebVector<WebNotificationAction> actions;
66 }; 94 };
67 95
68 } // namespace blink 96 } // namespace blink
69 97
70 #endif // WebNotificationData_h 98 #endif // WebNotificationData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698