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

Unified Diff: chrome/browser/notifications/notification_ui_manager_android.cc

Issue 1071773003: Remove persistent notifications from the database when they close. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-Integrate
Patch Set: rebase Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/notifications/persistent_notification_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9332bb0c43f413152806a0f91e4bc531d4e5b8b5..1d8f4822e78e3240f9cd14f45621e4c2f1851f9d 100644
--- a/chrome/browser/notifications/notification_ui_manager_android.cc
+++ b/chrome/browser/notifications/notification_ui_manager_android.cc
@@ -80,8 +80,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
+ // 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;
}
« no previous file with comments | « no previous file | chrome/browser/notifications/persistent_notification_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698