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

Side by Side Diff: components/sync/base/sync_prefs.cc

Issue 2710623003: [sync] Clean up path generation for the local sync database. (Closed)
Patch Set: Fix non-windows bots. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/base/sync_prefs.h" 5 #include "components/sync/base/sync_prefs.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 if (base::Base64Decode(encoded, &decoded)) { 548 if (base::Base64Decode(encoded, &decoded)) {
549 nigori_specifics->ParseFromString(decoded); 549 nigori_specifics->ParseFromString(decoded);
550 } 550 }
551 } 551 }
552 552
553 bool SyncPrefs::IsLocalSyncEnabled() const { 553 bool SyncPrefs::IsLocalSyncEnabled() const {
554 return pref_service_->GetBoolean(prefs::kEnableLocalSyncBackend); 554 return pref_service_->GetBoolean(prefs::kEnableLocalSyncBackend);
555 } 555 }
556 556
557 base::FilePath SyncPrefs::GetLocalSyncBackendDir() const { 557 base::FilePath SyncPrefs::GetLocalSyncBackendDir() const {
558 base::FilePath local_sync_backend_folder = 558 return pref_service_->GetFilePath(prefs::kLocalSyncBackendDir);
559 pref_service_->GetFilePath(prefs::kLocalSyncBackendDir);
560
561 #if defined(OS_WIN)
562 if (local_sync_backend_folder.empty()) {
563 // TODO(pastarmovj): Add DIR_ROAMING_USER_DATA to PathService to simplify
564 // this code and move the logic in its right place. See crbug/657810.
565 CHECK(
566 base::PathService::Get(base::DIR_APP_DATA, &local_sync_backend_folder));
567
568 // TODO(pastarmovj): Quick and dirty solution for stage 1 of crbug/694464
569 // for merging back into Chrome 57.
570 local_sync_backend_folder = local_sync_backend_folder.Append(
571 FILE_PATH_LITERAL("Google/Chrome/User Data"));
572 }
573 #endif // defined(OS_WIN)
574 return local_sync_backend_folder;
575 } 559 }
576 560
577 } // namespace syncer 561 } // namespace syncer
OLDNEW
« no previous file with comments | « components/browser_sync/profile_sync_service_unittest.cc ('k') | components/sync/driver/fake_sync_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698