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. |
skare_
2013/03/06 22:08:01
has this edit already been done in another review
vadimt
2013/03/06 22:37:12
"Yes" to both :)
The Races review (next in the que
skare_
2013/03/07 00:56:39
ok, great, thanks
On 2013/03/06 22:37:12, vadimt w
|
+// 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) && |
+ !items.activeNotifications[notificationId].hasUpdate) { |
chrome.experimental.notification.clear( |
notificationId, |
function(wasDeleted) {}); |