Chromium Code Reviews| Index: chrome/browser/notifications/notification_ui_manager_android.cc |
| diff --git a/chrome/browser/notifications/notification_ui_manager_android.cc b/chrome/browser/notifications/notification_ui_manager_android.cc |
| index 1cf6a7454fd72b0fefdac35a86f20f954ccc7d70..848fe9672415a00f5fd0fecf47524293bf3dc602 100644 |
| --- a/chrome/browser/notifications/notification_ui_manager_android.cc |
| +++ b/chrome/browser/notifications/notification_ui_manager_android.cc |
| @@ -231,6 +231,8 @@ void NotificationUIManagerAndroid::Add(const Notification& notification, |
| JNIEnv* env = AttachCurrentThread(); |
| + ScopedJavaLocalRef<jstring> tag = ConvertUTF16ToJavaString( |
| + env, profile_notification->notification().replace_id()); |
| ScopedJavaLocalRef<jstring> id = ConvertUTF8ToJavaString( |
| env, profile_notification->notification().id()); |
| ScopedJavaLocalRef<jstring> title = ConvertUTF16ToJavaString( |
| @@ -267,8 +269,8 @@ void NotificationUIManagerAndroid::Add(const Notification& notification, |
| } |
| int platform_id = Java_NotificationUIManager_displayNotification( |
| - env, java_object_.obj(), id.obj(), title.obj(), body.obj(), icon.obj(), |
| - origin.obj(), notification_data.obj()); |
| + env, java_object_.obj(), tag.obj(), id.obj(), title.obj(), body.obj(), |
| + icon.obj(), origin.obj(), notification_data.obj()); |
| std::string notification_id = profile_notification->notification().id(); |
| platform_notifications_[notification_id] = platform_id; |
| @@ -413,9 +415,20 @@ void NotificationUIManagerAndroid::PlatformCloseNotification( |
| int platform_id = iterator->second; |
| platform_notifications_.erase(notification_id); |
| - Java_NotificationUIManager_closeNotification(AttachCurrentThread(), |
| - java_object_.obj(), |
| - platform_id); |
| + ProfileNotification* profile_notification = |
| + FindProfileNotification(notification_id); |
| + if (!profile_notification) |
| + return; |
|
Peter Beverloo
2015/02/24 17:48:03
We don't add the notification to profile_notificat
Michael van Ouwerkerk
2015/02/25 18:12:45
Done.
|
| + |
| + JNIEnv* env = AttachCurrentThread(); |
| + |
| + ScopedJavaLocalRef<jstring> tag = ConvertUTF16ToJavaString( |
| + env, profile_notification->notification().replace_id()); |
| + ScopedJavaLocalRef<jstring> origin = ConvertUTF8ToJavaString( |
| + env, profile_notification->notification().origin_url().spec()); |
| + |
| + Java_NotificationUIManager_closeNotification( |
| + env, java_object_.obj(), tag.obj(), platform_id, origin.obj()); |
| } |
| void NotificationUIManagerAndroid::AddProfileNotification( |