Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: content/public/common/platform_notification_data.h

Issue 1388483002: Implement the Notification `timestamp` property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/common/content_export.h" 15 #include "content/common/content_export.h"
15 #include "url/gurl.h" 16 #include "url/gurl.h"
16 17
17 namespace content { 18 namespace content {
18 19
19 // A notification action (button); corresponds to Blink WebNotificationAction. 20 // A notification action (button); corresponds to Blink WebNotificationAction.
20 struct CONTENT_EXPORT PlatformNotificationAction { 21 struct CONTENT_EXPORT PlatformNotificationAction {
21 PlatformNotificationAction(); 22 PlatformNotificationAction();
22 ~PlatformNotificationAction(); 23 ~PlatformNotificationAction();
23 24
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // tag will replace the first displayed notification. 64 // tag will replace the first displayed notification.
64 std::string tag; 65 std::string tag;
65 66
66 // URL of the icon which is to be displayed with the notification. 67 // URL of the icon which is to be displayed with the notification.
67 GURL icon; 68 GURL icon;
68 69
69 // Vibration pattern for the notification, following the syntax of the 70 // Vibration pattern for the notification, following the syntax of the
70 // Vibration API. https://www.w3.org/TR/vibration/ 71 // Vibration API. https://www.w3.org/TR/vibration/
71 std::vector<int> vibration_pattern; 72 std::vector<int> vibration_pattern;
72 73
74 // The time at which the event the notification represents took place.
75 base::Time timestamp;
76
73 // Whether default notification indicators (sound, vibration, light) should 77 // Whether default notification indicators (sound, vibration, light) should
74 // be suppressed. 78 // be suppressed.
75 bool silent = false; 79 bool silent = false;
76 80
77 // Whether the notification should remain onscreen indefinitely, rather than 81 // Whether the notification should remain onscreen indefinitely, rather than
78 // being auto-minimized to the notification center (if allowed by platform). 82 // being auto-minimized to the notification center (if allowed by platform).
79 bool require_interaction = false; 83 bool require_interaction = false;
80 84
81 // Developer-provided data associated with the notification, in the form of 85 // Developer-provided data associated with the notification, in the form of
82 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. 86 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes.
83 std::vector<char> data; 87 std::vector<char> data;
84 88
85 // Actions that should be shown as buttons on the notification. 89 // Actions that should be shown as buttons on the notification.
86 std::vector<PlatformNotificationAction> actions; 90 std::vector<PlatformNotificationAction> actions;
87 }; 91 };
88 92
89 } // namespace content 93 } // namespace content
90 94
91 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ 95 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698