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(); |
+ } |
} |
/** |