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

Unified Diff: chrome/browser/resources/google_now/background.js

Issue 12508004: Enabling testing Google Now component extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rgustafson's notes Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
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) {});
« chrome/browser/chrome_browser_main.cc ('K') | « chrome/browser/chrome_browser_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698