| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/time/time.h" |
| 12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 // A notification action (button); corresponds to Blink WebNotificationAction. | 18 // A notification action (button); corresponds to Blink WebNotificationAction. |
| 18 struct CONTENT_EXPORT PlatformNotificationAction { | 19 struct CONTENT_EXPORT PlatformNotificationAction { |
| 19 PlatformNotificationAction(); | 20 PlatformNotificationAction(); |
| 20 ~PlatformNotificationAction(); | 21 ~PlatformNotificationAction(); |
| 21 | 22 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // tag will replace the first displayed notification. | 62 // tag will replace the first displayed notification. |
| 62 std::string tag; | 63 std::string tag; |
| 63 | 64 |
| 64 // URL of the icon which is to be displayed with the notification. | 65 // URL of the icon which is to be displayed with the notification. |
| 65 GURL icon; | 66 GURL icon; |
| 66 | 67 |
| 67 // Vibration pattern for the notification, following the syntax of the | 68 // Vibration pattern for the notification, following the syntax of the |
| 68 // Vibration API. https://www.w3.org/TR/vibration/ | 69 // Vibration API. https://www.w3.org/TR/vibration/ |
| 69 std::vector<int> vibration_pattern; | 70 std::vector<int> vibration_pattern; |
| 70 | 71 |
| 72 // The time at which the event the notification represents took place. |
| 73 base::Time timestamp; |
| 74 |
| 71 // Whether default notification indicators (sound, vibration, light) should | 75 // Whether default notification indicators (sound, vibration, light) should |
| 72 // be suppressed. | 76 // be suppressed. |
| 73 bool silent = false; | 77 bool silent = false; |
| 74 | 78 |
| 75 // Whether the notification should remain onscreen indefinitely, rather than | 79 // Whether the notification should remain onscreen indefinitely, rather than |
| 76 // being auto-minimized to the notification center (if allowed by platform). | 80 // being auto-minimized to the notification center (if allowed by platform). |
| 77 bool require_interaction = false; | 81 bool require_interaction = false; |
| 78 | 82 |
| 79 // Developer-provided data associated with the notification, in the form of | 83 // Developer-provided data associated with the notification, in the form of |
| 80 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. | 84 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. |
| 81 std::vector<char> data; | 85 std::vector<char> data; |
| 82 | 86 |
| 83 // Actions that should be shown as buttons on the notification. | 87 // Actions that should be shown as buttons on the notification. |
| 84 std::vector<PlatformNotificationAction> actions; | 88 std::vector<PlatformNotificationAction> actions; |
| 85 }; | 89 }; |
| 86 | 90 |
| 87 } // namespace content | 91 } // namespace content |
| 88 | 92 |
| 89 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ | 93 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ |
| OLD | NEW |