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

Unified Diff: chrome/browser/signin/token_service.cc

Issue 10656033: [sync] Automatic bootstrapping of Sync on Win 8 from cached credentials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 5 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 | « chrome/browser/signin/token_service.h ('k') | chrome/browser/sync/credential_cache_service_factory_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..536dcfa85d6dd65ed41bfd19e84204c1950cd31c 100644
--- a/chrome/browser/signin/token_service.cc
+++ b/chrome/browser/signin/token_service.cc
@@ -123,6 +123,9 @@ 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.
+ FireCredentialsUpdatedNotification(credentials.lsid, credentials.sid);
}
void TokenService::UpdateCredentialsWithOAuth2(
@@ -226,6 +229,16 @@ void TokenService::GetServiceNamesForTesting(std::vector<std::string>* names) {
std::copy(kServices, kServices + arraysize(kServices), names->begin());
}
+void TokenService::FireCredentialsUpdatedNotification(
+ const std::string& lsid,
+ const std::string& sid) {
+ CredentialsUpdatedDetails details(lsid, sid);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_TOKEN_SERVICE_CREDENTIALS_UPDATED,
+ content::Source<TokenService>(this),
+ content::Details<const CredentialsUpdatedDetails>(&details));
+}
+
// 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.
« no previous file with comments | « chrome/browser/signin/token_service.h ('k') | chrome/browser/sync/credential_cache_service_factory_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698