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

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

Issue 1083683003: Speculative revert by sheriff (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed an unrelated commit that had accidentally slipped in. Created 5 years, 8 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 <string> 8 #include <string>
9 #include <vector>
10 9
11 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
12 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
13 #include "url/gurl.h" 12 #include "url/gurl.h"
14 13
15 namespace content { 14 namespace content {
16 15
17 // Structure representing the information associated with a Web Notification. 16 // Structure representing the information associated with a Web Notification.
18 // This struct should include the developer-visible information, kept 17 // This struct should include the developer-visible information, kept
19 // synchronized with the WebNotificationData structure defined in the Blink API. 18 // synchronized with the WebNotificationData structure defined in the Blink API.
20 struct CONTENT_EXPORT PlatformNotificationData { 19 struct CONTENT_EXPORT PlatformNotificationData {
21 PlatformNotificationData(); 20 PlatformNotificationData();
22 ~PlatformNotificationData(); 21 ~PlatformNotificationData();
23 22
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;
27
28 enum NotificationDirection { 23 enum NotificationDirection {
29 NotificationDirectionLeftToRight, 24 NotificationDirectionLeftToRight,
30 NotificationDirectionRightToLeft, 25 NotificationDirectionRightToLeft,
31 26
32 NotificationDirectionLast = NotificationDirectionRightToLeft 27 NotificationDirectionLast = NotificationDirectionRightToLeft
33 }; 28 };
34 29
35 // Title to be displayed with the Web Notification. 30 // Title to be displayed with the Web Notification.
36 base::string16 title; 31 base::string16 title;
37 32
38 // Hint to determine the directionality of the displayed notification. 33 // Hint to determine the directionality of the displayed notification.
39 NotificationDirection direction = NotificationDirectionLeftToRight; 34 NotificationDirection direction;
40 35
41 // BCP 47 language tag describing the notification's contents. Optional. 36 // BCP 47 language tag describing the notification's contents. Optional.
42 std::string lang; 37 std::string lang;
43 38
44 // Contents of the notification. 39 // Contents of the notification.
45 base::string16 body; 40 base::string16 body;
46 41
47 // Tag of the notification. Notifications sharing both their origin and their 42 // Tag of the notification. Notifications sharing both their origin and their
48 // tag will replace the first displayed notification. 43 // tag will replace the first displayed notification.
49 std::string tag; 44 std::string tag;
50 45
51 // URL of the icon which is to be displayed with the notification. 46 // URL of the icon which is to be displayed with the notification.
52 GURL icon; 47 GURL icon;
53 48
54 // Whether default notification indicators (sound, vibration, light) should 49 // Whether default notification indicators (sound, vibration, light) should
55 // be suppressed. 50 // be suppressed.
56 bool silent = false; 51 bool silent;
57
58 // Developer-provided data associated with the notification, in the form of
59 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes.
60 std::vector<char> data;
61 }; 52 };
62 53
63 } // namespace content 54 } // namespace content
64 55
65 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ 56 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_
OLDNEW
« no previous file with comments | « content/common/platform_notification_messages.h ('k') | content/public/common/platform_notification_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698