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

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

Issue 1131933005: Sign in Now to GCM, only when user is signed in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm
Patch Set: Created 5 years, 7 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 2db2d1e6f8c2b094265dcf2992fdc4e7edba8f56..aebf1bee8d132166f4f3e177f03019bcba27a531 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,6 +1072,12 @@ function setShouldPollOptInStatus(shouldPollOptInStatus) {
'Action Ignored setShouldPollOptInStatus=' + shouldPollOptInStatus);
}
});
+
+ if (shouldPollOptInStatus) {
+ registerForGcm();
+ } else {
+ unregisterFromGcm();
+ }
}
/**
« 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