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

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

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: Fix unit tests 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/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index ef5eff0c9382fa1936b18ef0a068a38efb8e531f..48690578b79a8b6ab10cf77bfc69b930cb61931c 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -56,6 +56,7 @@ namespace sessions { class SyncSessionSnapshot; }
namespace syncer {
class BaseTransaction;
+class CredentialCacheService;
struct SyncCredentials;
struct UserShare;
}
@@ -515,6 +516,9 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
const GURL& sync_service_url() const { return sync_service_url_; }
bool auto_start_enabled() const { return auto_start_enabled_; }
SigninManager* signin() const { return signin_; }
+ base::WeakPtr<browser_sync::SyncPrefs> sync_prefs() {
+ return sync_prefs_.AsWeakPtr();
Andrew T Wilson (Slow) 2012/07/20 01:04:05 In the past, people who need to access SyncPrefs h
Raghu Simha 2012/07/20 23:35:22 I was under the (false) impression that only one S
+ }
// Stops the sync backend and sets the flag for suppressing sync startup.
void StopAndSuppress();
@@ -613,6 +617,17 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
friend class TestProfileSyncService;
FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState);
+ // Returns true if we are running on Windows 8, the user is not signed in to
+ // sync, sync is not disabled by policy, and startup is not suppressed.
+ // Used to prevent the user from having to sign in twice with the same account
+ // on Metro and Desktop Chrome.
+ bool ShouldInitializeCredentialCacheService();
+
+ // Returns true if we are running on Windows 8, the credential cache service
+ // is up and running, and credentials were successfully loaded from the
+ // alternate profile.
+ bool LoadedCachedCredentials();
+
// Starts up sync if it is not suppressed and preconditions are met.
// Called from Initialize() and UnsuppressAndStart().
void TryStart();
@@ -816,6 +831,9 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// Factory the backend will use to build the SyncManager.
syncer::SyncManagerFactory sync_manager_factory_;
+ // Used to share sync credentials between Metro and Desktop on Windows 8.
+ syncer::CredentialCacheService* credential_cache_service_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
};

Powered by Google App Engine
This is Rietveld 408576698