Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 // Maximum number of actions on a Platform Notification. | |
|
Peter Beverloo
2015/10/22 11:33:39
nit: s/Platform Notification/platform notification
| |
| 18 static const size_t kPlatformNotificationMaxActions = 2; | |
| 19 | |
| 20 // When a notification is clicked, passing this value for |actionIndex| | |
|
Peter Beverloo
2015/10/22 11:33:39
Referring to specific arguments has little meaning
| |
| 21 // indicates that the main body of the notification was clicked, rather than an | |
| 22 // action button. Must be kept in sync with | |
| 23 // NotificationUIManager.CLICK_WAS_NOT_AN_ACTION. | |
| 24 static const int kNotificationClickWasNotAnAction = -1; | |
|
Peter Beverloo
2015/10/22 11:33:39
kInvalidNotificationAction?
kNoNotificationAction?
| |
| 25 | |
| 17 // A notification action (button); corresponds to Blink WebNotificationAction. | 26 // A notification action (button); corresponds to Blink WebNotificationAction. |
| 18 struct CONTENT_EXPORT PlatformNotificationAction { | 27 struct CONTENT_EXPORT PlatformNotificationAction { |
| 19 PlatformNotificationAction(); | 28 PlatformNotificationAction(); |
| 20 ~PlatformNotificationAction(); | 29 ~PlatformNotificationAction(); |
| 21 | 30 |
| 22 // Action name that the author can use to distinguish them. | 31 // Action name that the author can use to distinguish them. |
| 23 std::string action; | 32 std::string action; |
| 24 | 33 |
| 25 // Title of the button. | 34 // Title of the button. |
| 26 base::string16 title; | 35 base::string16 title; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. | 89 // a serialized string. Must not exceed |kMaximumDeveloperDataSize| bytes. |
| 81 std::vector<char> data; | 90 std::vector<char> data; |
| 82 | 91 |
| 83 // Actions that should be shown as buttons on the notification. | 92 // Actions that should be shown as buttons on the notification. |
| 84 std::vector<PlatformNotificationAction> actions; | 93 std::vector<PlatformNotificationAction> actions; |
| 85 }; | 94 }; |
| 86 | 95 |
| 87 } // namespace content | 96 } // namespace content |
| 88 | 97 |
| 89 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ | 98 #endif // CONTENT_PUBLIC_COMMON_PLATFORM_NOTIFICATION_DATA_H_ |
| OLD | NEW |