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