| Index: chrome/browser/resources/google_now/utility.js
|
| diff --git a/chrome/browser/resources/google_now/utility.js b/chrome/browser/resources/google_now/utility.js
|
| index 418b6f3098d3e81e8fbfbdd80a4b7a8e218d6507..bfcb6ed076fdc3892b2b13433265944ef5ce702a 100644
|
| --- a/chrome/browser/resources/google_now/utility.js
|
| +++ b/chrome/browser/resources/google_now/utility.js
|
| @@ -393,6 +393,7 @@ var wrapper = (function() {
|
| wrapper.instrumentChromeApiFunction('alarms.get', 1);
|
| wrapper.instrumentChromeApiFunction('alarms.onAlarm.addListener', 0);
|
| wrapper.instrumentChromeApiFunction('identity.getAuthToken', 1);
|
| +wrapper.instrumentChromeApiFunction('identity.onSignInChanged.addListener', 0);
|
| wrapper.instrumentChromeApiFunction('identity.removeCachedAuthToken', 1);
|
|
|
| /**
|
| @@ -663,10 +664,7 @@ function buildAttemptManager(
|
| };
|
| }
|
|
|
| -// TODO(robliao): Ideally, the authentication watcher infrastructure
|
| -// below would be an API change to chrome.identity.
|
| -// When this happens, remove the code below.
|
| -
|
| +// TODO(robliao): Use signed-in state change watch API when it's available.
|
| /**
|
| * Wraps chrome.identity to provide limited listening support for
|
| * the sign in state by polling periodically for the auth token.
|
| @@ -734,6 +732,10 @@ function buildAuthenticationManager() {
|
| });
|
| }
|
|
|
| + instrumented.identity.onSignInChanged.addListener(function() {
|
| + isSignedIn(function() {});
|
| + });
|
| +
|
| instrumented.alarms.onAlarm.addListener(function(alarm) {
|
| if (alarm.name == alarmName)
|
| isSignedIn(function() {});
|
|
|