| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Show/hide trigger in a card. | 8 * Show/hide trigger in a card. |
| 9 * | 9 * |
| 10 * @typedef {{ | 10 * @typedef {{ |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 /** @type {Object.<string, NotificationDataEntry>} */ | 335 /** @type {Object.<string, NotificationDataEntry>} */ |
| 336 items.notificationsData = items.notificationsData || {}; | 336 items.notificationsData = items.notificationsData || {}; |
| 337 /** @type {Object.<string, StoredNotificationGroup>} */ | 337 /** @type {Object.<string, StoredNotificationGroup>} */ |
| 338 items.notificationGroups = items.notificationGroups || {}; | 338 items.notificationGroups = items.notificationGroups || {}; |
| 339 | 339 |
| 340 var combinedCard = | 340 var combinedCard = |
| 341 (items.notificationsData[cardId] && | 341 (items.notificationsData[cardId] && |
| 342 items.notificationsData[cardId].combinedCard) || []; | 342 items.notificationsData[cardId].combinedCard) || []; |
| 343 | 343 |
| 344 var cardShownCallback = undefined; | 344 var cardShownCallback = undefined; |
| 345 if (localStorage['locationCardsShown'] < | 345 if (localStorage['explanatoryCardsShown'] < |
| 346 LOCATION_CARDS_LINK_THRESHOLD) { | 346 EXPLANATORY_CARDS_LINK_THRESHOLD) { |
| 347 cardShownCallback = countLocationCard; | 347 cardShownCallback = countExplanatoryCard; |
| 348 } | 348 } |
| 349 | 349 |
| 350 items.notificationsData[cardId] = | 350 items.notificationsData[cardId] = |
| 351 update( | 351 update( |
| 352 cardId, | 352 cardId, |
| 353 combinedCard, | 353 combinedCard, |
| 354 items.notificationGroups, | 354 items.notificationGroups, |
| 355 cardShownCallback); | 355 cardShownCallback); |
| 356 | 356 |
| 357 chrome.storage.local.set(items); | 357 chrome.storage.local.set(items); |
| 358 }); | 358 }); |
| 359 }); | 359 }); |
| 360 } | 360 } |
| 361 }); | 361 }); |
| 362 | 362 |
| 363 return { | 363 return { |
| 364 update: update, | 364 update: update, |
| 365 onDismissal: onDismissal | 365 onDismissal: onDismissal |
| 366 }; | 366 }; |
| 367 } | 367 } |
| OLD | NEW |