| 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 75a8324cbc491e59406c4a07ffa8994d630be0eb..400409e630bec2dc23485853748e5ab47a3f700a 100644
|
| --- a/chrome/browser/resources/google_now/background.js
|
| +++ b/chrome/browser/resources/google_now/background.js
|
| @@ -84,9 +84,9 @@ var DEFAULT_OPTIN_CHECK_PERIOD_SECONDS = 60 * 60 * 24 * 7; // 1 week
|
| var SETTINGS_URL = 'https://support.google.com/chrome/?p=ib_google_now_welcome';
|
|
|
| /**
|
| - * Number of location cards that need an explanatory link.
|
| + * Number of cards that need an explanatory link.
|
| */
|
| -var LOCATION_CARDS_LINK_THRESHOLD = 10;
|
| +var EXPLANATORY_CARDS_LINK_THRESHOLD = 4;
|
|
|
| /**
|
| * Names for tasks that can be created by the extension.
|
| @@ -551,14 +551,10 @@ function processServerResponse(response, onCardShown) {
|
| }
|
|
|
| /**
|
| - * Update Location Cards Shown Count.
|
| - * @param {ReceivedNotification} receivedNotification Notification as it was
|
| - * received from the server.
|
| + * Update the Explanatory Total Cards Shown Count.
|
| */
|
| -function countLocationCard(receivedNotification) {
|
| - if (receivedNotification.locationBased) {
|
| - localStorage['locationCardsShown']++;
|
| - }
|
| +function countExplanatoryCard() {
|
| + localStorage['explanatoryCardsShown']++;
|
| }
|
|
|
| /**
|
| @@ -575,9 +571,11 @@ function requestNotificationGroups(groupNames) {
|
| (-new Date().getTimezoneOffset() * MS_IN_MINUTE);
|
|
|
| var cardShownCallback = undefined;
|
| - if (localStorage['locationCardsShown'] < LOCATION_CARDS_LINK_THRESHOLD) {
|
| - requestParameters += '&locationExplanation=true';
|
| - cardShownCallback = countLocationCard;
|
| + var belowExplanatoryThreshold =
|
| + localStorage['explanatoryCardsShown'] < EXPLANATORY_CARDS_LINK_THRESHOLD;
|
| + if (belowExplanatoryThreshold) {
|
| + requestParameters += '&cardExplanation=true';
|
| + cardShownCallback = countExplanatoryCard;
|
| }
|
|
|
| groupNames.forEach(function(groupName) {
|
|
|