[Android] Implement 3-way sensor fallback for Device Orientation.
[chromium-blink-merge.git] / content / public / common / platform_notification_data.h
blob5f43aeeaf6a619a8903357960a17792b800d3916
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_
8 #include <string>
9 #include <vector>
11 #include "base/strings/string16.h"
12 #include "content/common/content_export.h"
13 #include "url/gurl.h"
15 namespace content {
17 // A notification action (button); corresponds to Blink WebNotificationAction.
18 struct CONTENT_EXPORT PlatformNotificationAction {
19 PlatformNotificationAction();
20 ~PlatformNotificationAction();
22 // Action name that the author can use to distinguish them.
23 std::string action;
25 // Title of the button.
26 base::string16 title;
29 // Structure representing the information associated with a Web Notification.
30 // This struct should include the developer-visible information, kept
31 // synchronized with the WebNotificationData structure defined in the Blink API.
32 struct CONTENT_EXPORT PlatformNotificationData {
33 PlatformNotificationData();
34 ~PlatformNotificationData();
36 // The maximum size of developer-provided data to be stored in the |data|
37 // property of this structure.
38 static const size_t kMaximumDeveloperDataSize = 1024 * 1024;
40 enum Direction {
41 DIRECTION_LEFT_TO_RIGHT,
42 DIRECTION_RIGHT_TO_LEFT,
43 DIRECTION_AUTO,
45 DIRECTION_LAST = DIRECTION_AUTO
48 // Title to be displayed with the Web Notification.
49 base::string16 title;
51 // Hint to determine the directionality of the displayed notification.
52 Direction direction = DIRECTION_LEFT_TO_RIGHT;
54 // BCP 47 language tag describing the notification's contents. Optional.
55 std::string lang;
57 // Contents of the notification.
58 base::string16 body;
60 // Tag of the notification. Notifications sharing both their origin and their
61 // tag will replace the first displayed notification.
62 std::string tag;
64 // URL of the icon which is to be displayed with the notification.
65 GURL icon;
67 // Vibration pattern for the notification, following the syntax of the
68 // Vibration API. https://www.w3.org/TR/vibration/
69 std::vector<int> vibration_pattern;
71 // Whether default notification indicators (sound, vibration, light) should
72 // be suppressed.
73 bool silent = false;
75 // Developer-provided data associated with the notification, in the form of
76 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes.
77 std::vector<char> data;
79 // Actions that should be shown as buttons on the notification.
80 std::vector<PlatformNotificationAction> actions;
83 } // namespace content
85 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_