| 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/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| 20 // A notification action (button); corresponds to Blink WebNotificationAction. | 21 enum CONTENT_EXPORT PlatformNotificationActionType { |
| 22 PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON = 0, |
| 23 PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT, |
| 24 }; |
| 25 |
| 26 // A notification action (button or text input); corresponds to Blink |
| 27 // WebNotificationAction. |
| 21 struct CONTENT_EXPORT PlatformNotificationAction { | 28 struct CONTENT_EXPORT PlatformNotificationAction { |
| 22 PlatformNotificationAction(); | 29 PlatformNotificationAction(); |
| 23 ~PlatformNotificationAction(); | 30 ~PlatformNotificationAction(); |
| 24 | 31 |
| 32 // Type of the action (button or text input). |
| 33 PlatformNotificationActionType type; |
| 34 |
| 25 // Action name that the author can use to distinguish them. | 35 // Action name that the author can use to distinguish them. |
| 26 std::string action; | 36 std::string action; |
| 27 | 37 |
| 28 // Title of the button. | 38 // Title of the button. |
| 29 base::string16 title; | 39 base::string16 title; |
| 30 | 40 |
| 31 // URL of the icon for the button. May be empty if no url was specified. | 41 // URL of the icon for the button. May be empty if no url was specified. |
| 32 GURL icon; | 42 GURL icon; |
| 43 |
| 44 // Optional text to use as placeholder for text inputs. May be null if it was |
| 45 // not specified. |
| 46 base::NullableString16 placeholder; |
| 33 }; | 47 }; |
| 34 | 48 |
| 35 // Structure representing the information associated with a Web Notification. | 49 // Structure representing the information associated with a Web Notification. |
| 36 // This struct should include the developer-visible information, kept | 50 // This struct should include the developer-visible information, kept |
| 37 // synchronized with the WebNotificationData structure defined in the Blink API. | 51 // synchronized with the WebNotificationData structure defined in the Blink API. |
| 38 struct CONTENT_EXPORT PlatformNotificationData { | 52 struct CONTENT_EXPORT PlatformNotificationData { |
| 39 PlatformNotificationData(); | 53 PlatformNotificationData(); |
| 40 PlatformNotificationData(const PlatformNotificationData& other); | 54 PlatformNotificationData(const PlatformNotificationData& other); |
| 41 ~PlatformNotificationData(); | 55 ~PlatformNotificationData(); |
| 42 | 56 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. | 112 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. |
| 99 std::vector<char> data; | 113 std::vector<char> data; |
| 100 | 114 |
| 101 // Actions that should be shown as buttons on the notification. | 115 // Actions that should be shown as buttons on the notification. |
| 102 std::vector<PlatformNotificationAction> actions; | 116 std::vector<PlatformNotificationAction> actions; |
| 103 }; | 117 }; |
| 104 | 118 |
| 105 } // namespace content | 119 } // namespace content |
| 106 | 120 |
| 107 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ | 121 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ |
| OLD | NEW |