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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_
6 #define CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_
11 #include "base/strings/string16.h"
12 #include "content/common/content_export.h"
17 // Structure representing the information associated with a Web Notification.
18 // This struct should include the developer-visible information, kept
19 // synchronized with the WebNotificationData structure defined in the Blink API.
20 struct CONTENT_EXPORT PlatformNotificationData
{
21 PlatformNotificationData();
22 ~PlatformNotificationData();
24 // The maximum size of developer-provided data to be stored in the |data|
25 // property of this structure.
26 static const size_t kMaximumDeveloperDataSize
= 1024 * 1024;
28 enum NotificationDirection
{
29 NotificationDirectionLeftToRight
,
30 NotificationDirectionRightToLeft
,
32 NotificationDirectionLast
= NotificationDirectionRightToLeft
35 // Title to be displayed with the Web Notification.
38 // Hint to determine the directionality of the displayed notification.
39 NotificationDirection direction
= NotificationDirectionLeftToRight
;
41 // BCP 47 language tag describing the notification's contents. Optional.
44 // Contents of the notification.
47 // Tag of the notification. Notifications sharing both their origin and their
48 // tag will replace the first displayed notification.
51 // URL of the icon which is to be displayed with the notification.
54 // Vibration pattern for the notification, following the syntax of the
55 // Vibration API. https://www.w3.org/TR/vibration/
56 std::vector
<int> vibration_pattern
;
58 // Whether default notification indicators (sound, vibration, light) should
62 // Developer-provided data associated with the notification, in the form of
63 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes.
64 std::vector
<char> data
;
67 } // namespace content
69 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_