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

Side by Side Diff: chrome/browser/resources/google_now/cards.js

Issue 154653003: Count All Cards for Explanatory Link Support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/google_now/background.js ('k') | chrome/browser/resources/google_now/cards_unittest.gtestjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698