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

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

Issue 1267673003: Plumb Blink notification actions to button UI on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix size_t 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
« no previous file with comments | « content/content_common.gypi ('k') | content/public/common/platform_notification_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // A notification action (button); corresponds to Blink WebNotificationAction.
18 struct CONTENT_EXPORT PlatformNotificationAction {
19 PlatformNotificationAction();
20 ~PlatformNotificationAction();
21
22 // Action name that the author can use to distinguish them.
23 std::string action;
24
25 // Title of the button.
26 base::string16 title;
27 };
28
17 // Structure representing the information associated with a Web Notification. 29 // Structure representing the information associated with a Web Notification.
18 // This struct should include the developer-visible information, kept 30 // This struct should include the developer-visible information, kept
19 // synchronized with the WebNotificationData structure defined in the Blink API. 31 // synchronized with the WebNotificationData structure defined in the Blink API.
20 struct CONTENT_EXPORT PlatformNotificationData { 32 struct CONTENT_EXPORT PlatformNotificationData {
21 PlatformNotificationData(); 33 PlatformNotificationData();
22 ~PlatformNotificationData(); 34 ~PlatformNotificationData();
23 35
24 // The maximum size of developer-provided data to be stored in the |data| 36 // The maximum size of developer-provided data to be stored in the |data|
25 // property of this structure. 37 // property of this structure.
26 static const size_t kMaximumDeveloperDataSize = 1024 * 1024; 38 static const size_t kMaximumDeveloperDataSize = 1024 * 1024;
(...skipping 28 matching lines...) Expand all
55 // Vibration API. https://www.w3.org/TR/vibration/ 67 // Vibration API. https://www.w3.org/TR/vibration/
56 std::vector<int> vibration_pattern; 68 std::vector<int> vibration_pattern;
57 69
58 // Whether default notification indicators (sound, vibration, light) should 70 // Whether default notification indicators (sound, vibration, light) should
59 // be suppressed. 71 // be suppressed.
60 bool silent = false; 72 bool silent = false;
61 73
62 // Developer-provided data associated with the notification, in the form of 74 // Developer-provided data associated with the notification, in the form of
63 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. 75 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes.
64 std::vector<char> data; 76 std::vector<char> data;
77
78 // Actions that should be shown as buttons on the notification.
79 std::vector<PlatformNotificationAction> actions;
65 }; 80 };
66 81
67 } // namespace content 82 } // namespace content
68 83
69 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ 84 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_
OLDNEW
« no previous file with comments | « content/content_common.gypi ('k') | content/public/common/platform_notification_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698