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

Unified Diff: chrome/browser/resources/google_now/background.js

Issue 25097002: Cleaning data associated with the card upon deletion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cosmetics Created 7 years, 3 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
Index: chrome/browser/resources/google_now/background.js
diff --git a/chrome/browser/resources/google_now/background.js b/chrome/browser/resources/google_now/background.js
index 0dee0497dbb503bcb50b5f189cbea8d2f527813f..ee292e810f9a1dc12718831930378b06ed332780 100644
--- a/chrome/browser/resources/google_now/background.js
+++ b/chrome/browser/resources/google_now/background.js
@@ -299,7 +299,7 @@ function showNotificationCards(cards) {
if (!(chromeNotificationId in cards)) {
console.log(
'showNotificationCards-delete ' + chromeNotificationId);
- cardSet.clear(chromeNotificationId);
+ cardSet.clear(chromeNotificationId, false);
}
}
@@ -813,15 +813,16 @@ function onNotificationClosed(chromeNotificationId, byUser) {
tasks.add(DISMISS_CARD_TASK_NAME, function() {
dismissalAttempts.start();
- // Deleting the notification in case it was re-added while this task was
- // scheduled, waiting for execution.
- cardSet.clear(chromeNotificationId);
-
instrumented.storage.local.get(
['pendingDismissals', 'notificationsData'], function(items) {
items.pendingDismissals = items.pendingDismissals || [];
items.notificationsData = items.notificationsData || {};
+ // Deleting the notification in case it was re-added while this task was
+ // scheduled, waiting for execution; also cleaning notification's data
+ // from storage.
+ cardSet.clear(chromeNotificationId, true);
+
var notificationData = items.notificationsData[chromeNotificationId];
if (notificationData && notificationData.dismissals) {
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/cards.js » ('j') | chrome/browser/resources/google_now/cards.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698