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 aa5984cf9515cb91bc8f980498f6da65da1cd80b..640ffbfa8ab3ab6e84984e44c10b4625bba78061 100644 |
--- a/chrome/browser/notifications/notification_ui_manager_android.cc |
+++ b/chrome/browser/notifications/notification_ui_manager_android.cc |
@@ -95,8 +95,20 @@ bool NotificationUIManagerAndroid::OnNotificationClosed( |
jlong persistent_notification_id, |
jstring java_origin, |
jstring java_tag) { |
- // TODO(peter): Implement handling when a notification has been closed. The |
- // notification database has to reflect this in its own state. |
+ GURL origin(ConvertJavaStringToUTF8(env, java_origin)); |
+ std::string tag = ConvertJavaStringToUTF8(env, java_tag); |
+ |
+ // The notification was closed by the platform, so clear all local state. |
+ regenerated_notification_infos_.erase(persistent_notification_id); |
+ |
+ // TODO(peter): Rather than assuming that the last used profile is the |
dewittj
2015/04/10 17:18:30
can this happen sooner rather than later? Or do a
Peter Beverloo
2015/04/20 16:47:20
Chrome for Android only supports a single profile,
|
+ // appropriate one for this notification, the used profile should be |
+ // stored as part of the notification's data. See https://crbug.com/437574. |
+ PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClose( |
+ ProfileManager::GetLastUsedProfile(), |
+ persistent_notification_id, |
+ origin); |
+ |
return true; |
} |