| 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 enum CONTENT_EXPORT PlatformNotificationActionType { |
| 21 PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON = 0, |
| 22 PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT, |
| 23 }; |
| 24 |
| 25 // A notification action (button or text input); corresponds to Blink |
| 26 // WebNotificationAction. |
| 21 struct CONTENT_EXPORT PlatformNotificationAction { | 27 struct CONTENT_EXPORT PlatformNotificationAction { |
| 22 PlatformNotificationAction(); | 28 PlatformNotificationAction(); |
| 23 ~PlatformNotificationAction(); | 29 ~PlatformNotificationAction(); |
| 24 | 30 |
| 31 // Type of the action (button or text input). |
| 32 PlatformNotificationActionType type; |
| 33 |
| 34 // Optional text to use as placeholder for text inputs. May be empty if it was |
| 35 // not specified. |
| 36 base::string16 placeholder; |
| 37 |
| 25 // Action name that the author can use to distinguish them. | 38 // Action name that the author can use to distinguish them. |
| 26 std::string action; | 39 std::string action; |
| 27 | 40 |
| 28 // Title of the button. | 41 // Title of the button. |
| 29 base::string16 title; | 42 base::string16 title; |
| 30 | 43 |
| 31 // URL of the icon for the button. May be empty if no url was specified. | 44 // URL of the icon for the button. May be empty if no url was specified. |
| 32 GURL icon; | 45 GURL icon; |
| 33 }; | 46 }; |
| 34 | 47 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. | 111 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. |
| 99 std::vector<char> data; | 112 std::vector<char> data; |
| 100 | 113 |
| 101 // Actions that should be shown as buttons on the notification. | 114 // Actions that should be shown as buttons on the notification. |
| 102 std::vector<PlatformNotificationAction> actions; | 115 std::vector<PlatformNotificationAction> actions; |
| 103 }; | 116 }; |
| 104 | 117 |
| 105 } // namespace content | 118 } // namespace content |
| 106 | 119 |
| 107 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ | 120 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ |
| OLD | NEW |