Commit b4b13088 authored by skare's avatar skare Committed by Commit bot

Register Now for GCM, only when user is signed in.

BUG=480733

Review URL: https://codereview.chromium.org/1131933005

Cr-Commit-Position: refs/heads/master@{#330236}
parent 698ac976
......@@ -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();
}
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment