Chromium Code Reviews| Index: chrome/browser/signin/token_service.cc |
| diff --git a/chrome/browser/signin/token_service.cc b/chrome/browser/signin/token_service.cc |
| index 77345280f4942e8726866cc90be24d43d4a544c6..a9e8a0ca4d7a166bb8902949f9604717174dd280 100644 |
| --- a/chrome/browser/signin/token_service.cc |
| +++ b/chrome/browser/signin/token_service.cc |
| @@ -123,6 +123,10 @@ void TokenService::UpdateCredentials( |
| for (size_t i = 0; i < arraysize(kServices); i++) { |
| fetchers_[i].reset(); |
| } |
| + |
| + // Notify the CredentialCacheService that a new lsid and sid are available. |
| + FireCredentialUpdatedNotification(GaiaConstants::kGaiaLsid, credentials.lsid); |
| + FireCredentialUpdatedNotification(GaiaConstants::kGaiaSid, credentials.sid); |
| } |
| void TokenService::UpdateCredentialsWithOAuth2( |
| @@ -226,6 +230,16 @@ void TokenService::GetServiceNamesForTesting(std::vector<std::string>* names) { |
| std::copy(kServices, kServices + arraysize(kServices), names->begin()); |
| } |
| +void TokenService::FireCredentialUpdatedNotification( |
| + const std::string& credential_name, |
| + const std::string& credential_value) { |
| + TokenAvailableDetails details(credential_name, credential_value); |
| + content::NotificationService::current()->Notify( |
| + chrome::NOTIFICATION_TOKEN_SERVICE_CREDENTIALS_UPDATED, |
| + content::Source<TokenService>(this), |
| + content::Details<const TokenAvailableDetails>(&details)); |
|
Roger Tawa OOO till Jul 10th
2012/07/23 15:10:33
why not put both tokens in TokenAvailableDetails a
Raghu Simha
2012/07/23 20:35:54
That's because TokenAvailableDetails has only one
|
| +} |
| + |
| // Note that this can fire twice or more for any given service. |
| // It can fire once from the DB read, and then once from the initial |
| // fetcher. Future fetches can cause more notification firings. |