Index: chrome/browser/sync/credential_cache_service_win.cc |
diff --git a/chrome/browser/sync/credential_cache_service_win.cc b/chrome/browser/sync/credential_cache_service_win.cc |
index 9c938d0b5e1d2113fe53b8658a91f7e618af5501..8d05e0d6dc3041eea22fe9e000d23039c42a7b63 100644 |
--- a/chrome/browser/sync/credential_cache_service_win.cc |
+++ b/chrome/browser/sync/credential_cache_service_win.cc |
@@ -94,24 +94,6 @@ void CredentialCacheService::Observe( |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
DCHECK(local_store_.get()); |
switch (type) { |
- case chrome::NOTIFICATION_PREF_CHANGED: { |
- // One of the two sync encryption tokens has changed. Update its value in |
- // the local cache. |
- const std::string pref_name = |
- *(content::Details<const std::string>(details).ptr()); |
- if (pref_name == prefs::kSyncEncryptionBootstrapToken) { |
- PackAndUpdateStringPref(pref_name, |
- sync_prefs_.GetEncryptionBootstrapToken()); |
- } else if (pref_name == prefs::kSyncKeystoreEncryptionBootstrapToken) { |
- PackAndUpdateStringPref( |
- pref_name, |
- sync_prefs_.GetKeystoreEncryptionBootstrapToken()); |
- } else { |
- NOTREACHED() "Invalid pref name " << pref_name << "."; |
- } |
- break; |
- } |
- |
case chrome::NOTIFICATION_GOOGLE_SIGNED_OUT: { |
// The user has signed out. Write blank values to the google username, |
// encryption tokens and token service credentials in the local cache. |
@@ -193,6 +175,22 @@ void CredentialCacheService::Observe( |
} |
} |
+void CredentialCacheService::OnPreferenceChanged(PrefServiceBase* service, |
+ const std::string& pref_name) { |
+ // One of the two sync encryption tokens has changed. Update its value in |
+ // the local cache. |
+ if (pref_name == prefs::kSyncEncryptionBootstrapToken) { |
+ PackAndUpdateStringPref(pref_name, |
+ sync_prefs_.GetEncryptionBootstrapToken()); |
+ } else if (pref_name == prefs::kSyncKeystoreEncryptionBootstrapToken) { |
+ PackAndUpdateStringPref( |
+ pref_name, |
+ sync_prefs_.GetKeystoreEncryptionBootstrapToken()); |
+ } else { |
+ NOTREACHED() "Invalid pref name " << pref_name << "."; |
+ } |
+} |
+ |
void CredentialCacheService::ReadCachedCredentialsFromAlternateProfile() { |
// If the local user has signed in and signed out, we do not consume cached |
// credentials from the alternate profile. There is nothing more to do, now or |