Chromium Code Reviews| 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 a9d04d878a71e1dc880732de9a12af58e12ef2ab..136609ea19c4c70a61ab7cdfdc4c8aa074d8b386 100644 |
| --- a/chrome/browser/resources/google_now/background.js |
| +++ b/chrome/browser/resources/google_now/background.js |
| @@ -25,14 +25,14 @@ |
| // TODO(vadimt): Report internal and server errors. Collect UMAs on errors where |
| // appropriate. Also consider logging errors or throwing exceptions. |
| -// TODO(vadimt): Figure out the server name. Use it in the manifest and for |
| // TODO(vadimt): Consider processing errors for all storage.set calls. |
| +// TODO(vadimt): Figure out the server name. Use it in the manifest and for |
| // NOTIFICATION_CARDS_URL. Meanwhile, to use the feature, you need to manually |
| -// edit NOTIFICATION_CARDS_URL before building Chrome. |
| +// set the server name via local storage. |
| /** |
| * URL to retrieve notification cards. |
| */ |
| -var NOTIFICATION_CARDS_URL = ''; |
| +var NOTIFICATION_CARDS_URL = localStorage['server_url']; |
| /** |
| * Standard response code for successful HTTP requests. This is the only success |
| @@ -108,7 +108,8 @@ function parseAndShowNotificationCards(response) { |
| // Delete notifications that didn't receive an update. |
| for (var notificationId in items.activeNotifications) |
| - if (!items.activeNotifications[notificationId].hasUpdate) { |
| + if (items.activeNotifications.hasOwnProperty(notificationId) && |
|
arv (Not doing code reviews)
2013/03/11 16:04:21
Does it matter if it is "own" or "in"?
if (notifi
vadimt
2013/03/11 16:51:03
OK, I'm removing this line.
It looks like I've ad
|
| + !items.activeNotifications[notificationId].hasUpdate) { |
| chrome.notifications.clear( |
| notificationId, |
| function(wasDeleted) {}); |