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

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

Issue 1262023003: Serialize Notification.direction == "auto" in the database (2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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> 9 #include <vector>
10 10
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 // Structure representing the information associated with a Web Notification. 17 // Structure representing the information associated with a Web Notification.
18 // This struct should include the developer-visible information, kept 18 // This struct should include the developer-visible information, kept
19 // synchronized with the WebNotificationData structure defined in the Blink API. 19 // synchronized with the WebNotificationData structure defined in the Blink API.
20 struct CONTENT_EXPORT PlatformNotificationData { 20 struct CONTENT_EXPORT PlatformNotificationData {
21 PlatformNotificationData(); 21 PlatformNotificationData();
22 ~PlatformNotificationData(); 22 ~PlatformNotificationData();
23 23
24 // The maximum size of developer-provided data to be stored in the |data| 24 // The maximum size of developer-provided data to be stored in the |data|
25 // property of this structure. 25 // property of this structure.
26 static const size_t kMaximumDeveloperDataSize = 1024 * 1024; 26 static const size_t kMaximumDeveloperDataSize = 1024 * 1024;
27 27
28 enum NotificationDirection { 28 enum Direction {
29 NotificationDirectionLeftToRight, 29 DIRECTION_LEFT_TO_RIGHT,
30 NotificationDirectionRightToLeft, 30 DIRECTION_RIGHT_TO_LEFT,
31 DIRECTION_AUTO,
31 32
32 NotificationDirectionLast = NotificationDirectionRightToLeft 33 DIRECTION_LAST = DIRECTION_AUTO
33 }; 34 };
34 35
35 // Title to be displayed with the Web Notification. 36 // Title to be displayed with the Web Notification.
36 base::string16 title; 37 base::string16 title;
37 38
38 // Hint to determine the directionality of the displayed notification. 39 // Hint to determine the directionality of the displayed notification.
39 NotificationDirection direction = NotificationDirectionLeftToRight; 40 Direction direction = DIRECTION_LEFT_TO_RIGHT;
40 41
41 // BCP 47 language tag describing the notification's contents. Optional. 42 // BCP 47 language tag describing the notification's contents. Optional.
42 std::string lang; 43 std::string lang;
43 44
44 // Contents of the notification. 45 // Contents of the notification.
45 base::string16 body; 46 base::string16 body;
46 47
47 // Tag of the notification. Notifications sharing both their origin and their 48 // Tag of the notification. Notifications sharing both their origin and their
48 // tag will replace the first displayed notification. 49 // tag will replace the first displayed notification.
49 std::string tag; 50 std::string tag;
(...skipping 10 matching lines...) Expand all
60 bool silent = false; 61 bool silent = false;
61 62
62 // Developer-provided data associated with the notification, in the form of 63 // Developer-provided data associated with the notification, in the form of
63 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. 64 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes.
64 std::vector<char> data; 65 std::vector<char> data;
65 }; 66 };
66 67
67 } // namespace content 68 } // namespace content
68 69
69 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ 70 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698