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

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

Issue 1071393005: [TEST ONLY] Run tests for 1093943003 Base URL: https://chromium.googlesource.com/chromium/src.git@gcm
Patch Set: reupload after merge Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9da2b04dfabc7b9f9748f1be0c405d96e575d482..f83d66c5a400cc9a036137a194b7465acb3f143b 100644
--- a/chrome/browser/resources/google_now/background.js
+++ b/chrome/browser/resources/google_now/background.js
@@ -1028,8 +1028,6 @@ function stopPollingCards() {
*/
function initialize() {
recordEvent(GoogleNowEvent.EXTENSION_START);
- // TODO(skare): Reenable, after signin.
- unregisterFromGcm();
onStateChange();
}
@@ -1054,7 +1052,8 @@ function setShouldPollCards(shouldPollCardsRequest) {
}
/**
- * Starts or stops the optin check.
+ * Starts or stops the optin check and GCM channel to receive optin
+ * notifications.
* @param {boolean} shouldPollOptInStatus true to start and false to stop
* polling the optin status.
*/
@@ -1073,8 +1072,15 @@ function setShouldPollOptInStatus(shouldPollOptInStatus) {
'Action Ignored setShouldPollOptInStatus=' + shouldPollOptInStatus);
}
});
+
+ if (shouldPollOptInStatus) {
+ registerForGcm();
+ } else {
+ unregisterFromGcm();
+ }
}
+
/**
* Enables or disables the Google Now background permission.
* @param {boolean} backgroundEnable true to run in the background.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698