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

Unified Diff: components/sync/base/sync_prefs.cc

Issue 2494873003: [Sync] Allow sync start without sign-in if the local sync backend is on. (Closed)
Patch Set: Remove ifdefs around include. Created 4 years 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 | « components/sync/BUILD.gn ('k') | components/sync/driver/fake_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/base/sync_prefs.cc
diff --git a/components/sync/base/sync_prefs.cc b/components/sync/base/sync_prefs.cc
index e0adcb38606f0a19b0705b1dc796ddc2d8847481..25b54cf3fcb09991fe15503e52edb090d6c0607c 100644
--- a/components/sync/base/sync_prefs.cc
+++ b/components/sync/base/sync_prefs.cc
@@ -5,7 +5,9 @@
#include "components/sync/base/sync_prefs.h"
#include "base/base64.h"
+#include "base/files/file_path.h"
#include "base/logging.h"
+#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "components/pref_registry/pref_registry_syncable.h"
@@ -553,7 +555,20 @@ bool SyncPrefs::IsLocalSyncEnabled() const {
}
base::FilePath SyncPrefs::GetLocalSyncBackendDir() const {
- return pref_service_->GetFilePath(prefs::kLocalSyncBackendDir);
+ base::FilePath local_sync_backend_folder =
+ pref_service_->GetFilePath(prefs::kLocalSyncBackendDir);
+
+#if defined(OS_WIN)
+ if (local_sync_backend_folder.empty()) {
+ // TODO(pastarmovj): Add DIR_ROAMING_USER_DATA to PathService to simplify
+ // this code and move the logic in its right place. See crbug/657810.
+ CHECK(
+ base::PathService::Get(base::DIR_APP_DATA, &local_sync_backend_folder));
+ local_sync_backend_folder =
+ local_sync_backend_folder.Append(FILE_PATH_LITERAL("Chrome/User Data"));
+ }
+#endif // defined(OS_WIN)
+ return local_sync_backend_folder;
}
} // namespace syncer
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/driver/fake_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698