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

Unified Diff: chrome/browser/sync/credential_cache_service_win.h

Issue 10828108: [sync] Add a polling mechanism to CredentialCacheService for on-the-fly sign in / sign out / reconf… (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
Index: chrome/browser/sync/credential_cache_service_win.h
diff --git a/chrome/browser/sync/credential_cache_service_win.h b/chrome/browser/sync/credential_cache_service_win.h
index bd584ef9822816643924be8ef5219a20627c68c8..990bb8e5bfbf35c3813d755e332c1c6188f6448a 100644
--- a/chrome/browser/sync/credential_cache_service_win.h
+++ b/chrome/browser/sync/credential_cache_service_win.h
@@ -144,14 +144,50 @@ class CredentialCacheService : public ProfileKeyedService,
// ApplyCachedCredentials if the load was successful.
void ReadCachedCredentialsFromAlternateProfile();
- // Applies the credentials read from the alternate profile to the PrefStore
- // and TokenService of the local profile and then notifies listeners.
- void ApplyCachedCredentials(const std::string& google_services_username,
- const std::string& lsid,
- const std::string& sid,
- const std::string& encryption_bootstrap_token,
- bool keep_everything_synced,
- const bool datatype_prefs[]);
+ // Initiates sync sign in using credentials read from the alternate profile by
+ // persisting |google_services_username|, |encryption_bootstrap_token|,
+ // |keep_everything_synced| and |preferred_types| to the local pref store, and
+ // preparing ProfileSyncService for sign in.
+ void InitiateSignInWithCachedCredentials(
+ const std::string& google_services_username,
+ const std::string& encryption_bootstrap_token,
+ bool keep_everything_synced,
+ ModelTypeSet preferred_types);
+
+ // Updates the TokenService credentials with |lsid| and |sid| and triggers the
+ // minting of new tokens for all Chrome services. ProfileSyncService is
+ // automatically notified when tokens are minted, and goes on to consume the
+ // updated credentials.
+ void UpdateTokenServiceCredentials(const std::string& lsid,
+ const std::string& sid);
+
+ // Initiates a sign out of sync. Called when we notice that the user has
+ // signed out from the alternate mode by reading its credential cache.
+ void InitiateSignOut();
+
+ // Compares the sync preferences in the local profile with values that were
+ // read from the alternate profile -- |keep_everything_synced| and
+ // |preferred_types|. Returns true if the prefs have changed, and false
+ // otherwise.
+ bool HaveSyncPrefsChanged(bool keep_everything_synced,
+ const ModelTypeSet& preferred_types) const;
+
+ // Compares the token service credentials in the local profile with values
+ // that were read from the alternate profile -- |lsid| and |sid|. Returns true
+ // if the credentials have changed, and false otherwise.
+ bool HaveTokenServiceCredentialsChanged(const std::string& lsid,
+ const std::string& sid);
+
+ // Determines if sync settings may be reconfigured or not. Called when
+ // updated settings are noticed in the alternate credential cache for
+ // |google_services_username|. Returns true if we may reconfigure, and false
+ // if not.
+ bool CredentialCacheService::MayReconfigureSync(
+ const std::string& google_services_username);
+
+ // Resets |alternate_store_| and schedules the next read from the alternate
+ // credential cache.
+ void ScheduleNextReadFromAlternateCredentialCache();
// Profile for which credentials are being cached.
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698