Index: chrome/browser/resources/google_now/cards.js |
diff --git a/chrome/browser/resources/google_now/cards.js b/chrome/browser/resources/google_now/cards.js |
index 4c40ba6f51ab93cd01547e88243db8d1fb373c36..81b89bf90d83aae560eca85ff8b45433e586e96b 100644 |
--- a/chrome/browser/resources/google_now/cards.js |
+++ b/chrome/browser/resources/google_now/cards.js |
@@ -327,35 +327,33 @@ function buildCardSet() { |
// Alarm to show the card. |
tasks.add(UPDATE_CARD_TASK_NAME, function() { |
var cardId = alarm.name.substring(alarmPrefix.length); |
- instrumented.storage.local.get( |
- ['notificationsData', 'notificationGroups'], |
- function(items) { |
- console.log('cardManager.onAlarm.get ' + JSON.stringify(items)); |
- items = items || {}; |
- /** @type {Object.<string, NotificationDataEntry>} */ |
- items.notificationsData = items.notificationsData || {}; |
- /** @type {Object.<string, StoredNotificationGroup>} */ |
- items.notificationGroups = items.notificationGroups || {}; |
- |
- var combinedCard = |
- (items.notificationsData[cardId] && |
- items.notificationsData[cardId].combinedCard) || []; |
- |
- var cardShownCallback = undefined; |
- if (localStorage['explanatoryCardsShown'] < |
- EXPLANATORY_CARDS_LINK_THRESHOLD) { |
- cardShownCallback = countExplanatoryCard; |
- } |
- |
- items.notificationsData[cardId] = |
- update( |
- cardId, |
- combinedCard, |
- items.notificationGroups, |
- cardShownCallback); |
- |
- chrome.storage.local.set(items); |
- }); |
+ fillFromChromeLocalStorage({ |
+ /** @type {Object.<string, NotificationDataEntry>} */ |
+ notificationsData: {}, |
+ /** @type {Object.<string, StoredNotificationGroup>} */ |
+ notificationGroups: {} |
+ }).then(function(items) { |
+ console.log('cardManager.onAlarm.get ' + JSON.stringify(items)); |
+ |
+ var combinedCard = |
+ (items.notificationsData[cardId] && |
+ items.notificationsData[cardId].combinedCard) || []; |
+ |
+ var cardShownCallback = undefined; |
+ if (localStorage['explanatoryCardsShown'] < |
+ EXPLANATORY_CARDS_LINK_THRESHOLD) { |
+ cardShownCallback = countExplanatoryCard; |
+ } |
+ |
+ items.notificationsData[cardId] = |
+ update( |
+ cardId, |
+ combinedCard, |
+ items.notificationGroups, |
+ cardShownCallback); |
+ |
+ chrome.storage.local.set(items); |
+ }); |
}); |
} |
}); |