Chromium Code Reviews| Index: chrome/browser/notifications/notification_platform_bridge_android.cc |
| diff --git a/chrome/browser/notifications/notification_platform_bridge_android.cc b/chrome/browser/notifications/notification_platform_bridge_android.cc |
| index a7d4b148c9a7d1969481d11455aad9f3d3f750db..7c8fd5532485aca414648e16eb60ed912aee9c4d 100644 |
| --- a/chrome/browser/notifications/notification_platform_bridge_android.cc |
| +++ b/chrome/browser/notifications/notification_platform_bridge_android.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/logging.h" |
| #include "base/strings/string_number_conversions.h" |
| +#include "base/strings/utf_string_conversions.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/notifications/native_notification_display_service.h" |
| #include "chrome/browser/notifications/notification.h" |
| @@ -228,6 +229,28 @@ void NotificationPlatformBridgeAndroid::Display( |
| ScopedJavaLocalRef<jobjectArray> action_icons = |
| ConvertToJavaBitmaps(notification.buttons()); |
| + std::vector<base::string16> action_types_vector; |
| + for (const message_center::ButtonInfo& button : notification.buttons()) { |
| + if (button.type == message_center::NotificationActionType::TEXT) { |
| + action_types_vector.push_back(base::ASCIIToUTF16("text")); |
|
awdf
2016/09/13 14:14:55
I'm aware I probably want a vector of booleans or
Peter Beverloo
2016/09/14 16:27:12
I think you're looking at too small of a problem—
awdf
2016/09/22 14:17:11
Sure, it would definitely be nice to cut down the
awdf
2016/09/26 15:33:28
Is it reasonable for me to create a Chromium issue
Peter Beverloo
2016/09/26 16:04:34
Absolutely :) Bugs are free.
|
| + } else { |
| + action_types_vector.push_back(base::ASCIIToUTF16("button")); |
| + } |
| + } |
| + ScopedJavaLocalRef<jobjectArray> action_types = |
| + base::android::ToJavaArrayOfStrings(env, action_types_vector); |
| + |
| + std::vector<base::string16> action_placeholders_vector; |
| + for (const message_center::ButtonInfo& button : notification.buttons()) { |
| + if (!button.placeholder.is_null()) { |
| + action_placeholders_vector.push_back(button.placeholder.string()); |
| + } else { |
| + action_placeholders_vector.push_back(base::ASCIIToUTF16("")); |
| + } |
| + } |
| + ScopedJavaLocalRef<jobjectArray> action_placeholders = |
| + base::android::ToJavaArrayOfStrings(env, action_placeholders_vector); |
| + |
| ScopedJavaLocalRef<jintArray> vibration_pattern = |
| base::android::ToJavaIntArray(env, notification.vibration_pattern()); |
| @@ -239,7 +262,7 @@ void NotificationPlatformBridgeAndroid::Display( |
| tag, webapk_package, title, body, image, notification_icon, badge, |
| vibration_pattern, notification.timestamp().ToJavaTime(), |
| notification.renotify(), notification.silent(), action_titles, |
| - action_icons); |
| + action_icons, action_types, action_placeholders); |
| regenerated_notification_infos_[notification_id] = |
| RegeneratedNotificationInfo(origin_url.spec(), notification.tag(), |