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

Unified Diff: chrome/browser/sync/profile_sync_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: Fix TokenServiceTests 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.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 7fa28b89d5b21eead6ff2fe2cc757b6a56e3e707..1b0bc3ac31323e99a5309546d8ebbeb9b081ea8d 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -21,6 +21,9 @@
#include "base/string16.h"
#include "base/stringprintf.h"
#include "base/threading/thread_restrictions.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
#include "chrome/browser/about_flags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/defaults.h"
@@ -31,6 +34,8 @@
#include "chrome/browser/signin/token_service.h"
#include "chrome/browser/signin/token_service_factory.h"
#include "chrome/browser/sync/backend_migrator.h"
+#include "chrome/browser/sync/credential_cache_service_factory_win.h"
+#include "chrome/browser/sync/credential_cache_service_win.h"
#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/chrome_encryptor.h"
#include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h"
@@ -69,6 +74,8 @@ using browser_sync::ChangeProcessor;
using browser_sync::DataTypeController;
using browser_sync::DataTypeManager;
using browser_sync::SyncBackendHost;
+using syncer::CredentialCacheService;
+using syncer::CredentialCacheServiceFactory;
using syncer::ModelType;
using syncer::ModelTypeSet;
using syncer::JsBackend;
@@ -139,7 +146,8 @@ ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory,
auto_start_enabled_(start_behavior == AUTO_START),
failed_datatypes_handler_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
configure_status_(DataTypeManager::UNKNOWN),
- setup_in_progress_(false) {
+ setup_in_progress_(false),
+ credential_cache_service_(NULL) {
#if defined(OS_ANDROID)
chrome::VersionInfo version_info;
if (version_info.IsOfficialBuild()) {
@@ -205,12 +213,28 @@ void ProfileSyncService::Initialize() {
DisableForUser();
}
+#if defined(OS_WIN)
+ // Initialize the CredentialCacheService for the default profile on Windows 8.
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
+ CredentialCacheService::IsDefaultProfileDir(profile()->GetPath()) &&
+ !sync_prefs_.IsStartSuppressed()) {
+ credential_cache_service_ =
+ CredentialCacheServiceFactory::GetInstance()->GetForProfile(profile_);
+ }
+#endif // OS_WIN
+
TryStart();
}
void ProfileSyncService::TryStart() {
- if (!IsSyncEnabledAndLoggedIn())
+ if (!IsSyncEnabledAndLoggedIn()) {
Roger Tawa OOO till Jul 10th 2012/07/23 15:10:33 Is this right condition? For example, if IsStartS
Raghu Simha 2012/07/23 20:35:54 I believe it is the right condition. We do make su
+#if defined(OS_WIN)
+ if (credential_cache_service_)
+ credential_cache_service_->LookForCachedCredentialsInAlternateProfile();
+#endif // OS_WIN
return;
+ }
+
TokenService* token_service = TokenServiceFactory::GetForProfile(profile_);
if (!token_service)
return;

Powered by Google App Engine
This is Rietveld 408576698