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/nullable_string16.h" | 13 #include "base/strings/nullable_string16.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 enum PlatformNotificationActionType { | 21 enum PlatformNotificationActionType { |
22 PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON = 0, | 22 PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON = 0, |
23 PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT, | 23 PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT, |
24 }; | 24 }; |
25 | 25 |
26 // A notification action (button or text input); corresponds to Blink | 26 // A notification action (button or text input); corresponds to Blink |
27 // WebNotificationAction. | 27 // WebNotificationAction. |
28 struct CONTENT_EXPORT PlatformNotificationAction { | 28 struct CONTENT_EXPORT PlatformNotificationAction { |
29 PlatformNotificationAction(); | 29 PlatformNotificationAction(); |
| 30 PlatformNotificationAction(const PlatformNotificationAction& other); |
30 ~PlatformNotificationAction(); | 31 ~PlatformNotificationAction(); |
31 | 32 |
32 // Type of the action (button or text input). | 33 // Type of the action (button or text input). |
33 PlatformNotificationActionType type; | 34 PlatformNotificationActionType type; |
34 | 35 |
35 // Action name that the author can use to distinguish them. | 36 // Action name that the author can use to distinguish them. |
36 std::string action; | 37 std::string action; |
37 | 38 |
38 // Title of the button. | 39 // Title of the button. |
39 base::string16 title; | 40 base::string16 title; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. | 113 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. |
113 std::vector<char> data; | 114 std::vector<char> data; |
114 | 115 |
115 // Actions that should be shown as buttons on the notification. | 116 // Actions that should be shown as buttons on the notification. |
116 std::vector<PlatformNotificationAction> actions; | 117 std::vector<PlatformNotificationAction> actions; |
117 }; | 118 }; |
118 | 119 |
119 } // namespace content | 120 } // namespace content |
120 | 121 |
121 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ | 122 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ |
OLD | NEW |