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 63645f8dfc6fbb011f2691be38abf090d2b79430..af41db1a774affd19c72ac744e93bb2ce724d2f6 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) && |
|
rgustafson
2013/03/06 02:51:57
What is this doing here? Leak from some other chan
vadimt
2013/03/06 21:44:40
Just fixing a bug. In general, this is a right way
rgustafson
2013/03/06 22:56:01
Okay.
On 2013/03/06 21:44:40, vadimt wrote:
|
| + !items.activeNotifications[notificationId].hasUpdate) { |
| chrome.experimental.notification.clear( |
| notificationId, |
| function(wasDeleted) {}); |