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 CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ |
6 #define CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ | 6 #define CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 // A notification action (button); corresponds to Blink WebNotificationAction. | 20 // A notification action (button); corresponds to Blink WebNotificationAction. |
21 struct CONTENT_EXPORT PlatformNotificationAction { | 21 struct CONTENT_EXPORT PlatformNotificationAction { |
22 PlatformNotificationAction(); | 22 PlatformNotificationAction(); |
23 ~PlatformNotificationAction(); | 23 ~PlatformNotificationAction(); |
24 | 24 |
25 // Action name that the author can use to distinguish them. | 25 // Action name that the author can use to distinguish them. |
26 std::string action; | 26 std::string action; |
27 | 27 |
28 // Title of the button. | 28 // Title of the button. |
29 base::string16 title; | 29 base::string16 title; |
| 30 |
| 31 // URL of the icon for the button. May be empty if no url was specified. |
| 32 GURL icon; |
30 }; | 33 }; |
31 | 34 |
32 // Structure representing the information associated with a Web Notification. | 35 // Structure representing the information associated with a Web Notification. |
33 // This struct should include the developer-visible information, kept | 36 // This struct should include the developer-visible information, kept |
34 // synchronized with the WebNotificationData structure defined in the Blink API. | 37 // synchronized with the WebNotificationData structure defined in the Blink API. |
35 struct CONTENT_EXPORT PlatformNotificationData { | 38 struct CONTENT_EXPORT PlatformNotificationData { |
36 PlatformNotificationData(); | 39 PlatformNotificationData(); |
37 ~PlatformNotificationData(); | 40 ~PlatformNotificationData(); |
38 | 41 |
39 // The maximum size of developer-provided data to be stored in the |data| | 42 // The maximum size of developer-provided data to be stored in the |data| |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. | 89 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. |
87 std::vector<char> data; | 90 std::vector<char> data; |
88 | 91 |
89 // Actions that should be shown as buttons on the notification. | 92 // Actions that should be shown as buttons on the notification. |
90 std::vector<PlatformNotificationAction> actions; | 93 std::vector<PlatformNotificationAction> actions; |
91 }; | 94 }; |
92 | 95 |
93 } // namespace content | 96 } // namespace content |
94 | 97 |
95 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ | 98 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ |
OLD | NEW |