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

Side by Side Diff: components/browser_sync/profile_sync_service.cc

Issue 2528163002: Rewire the local sync switches through the pref store. (Closed)
Patch Set: Comment new SyncPrefs methods. 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 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/browser_sync/profile_sync_service.h" 5 #include "components/browser_sync/profile_sync_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <map> 10 #include <map>
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 options.timer_slack = base::TIMER_SLACK_MAXIMUM; 500 options.timer_slack = base::TIMER_SLACK_MAXIMUM;
501 CHECK(sync_thread_->StartWithOptions(options)); 501 CHECK(sync_thread_->StartWithOptions(options));
502 } 502 }
503 503
504 SyncCredentials credentials = GetCredentials(); 504 SyncCredentials credentials = GetCredentials();
505 505
506 if (delete_stale_data) 506 if (delete_stale_data)
507 ClearStaleErrors(); 507 ClearStaleErrors();
508 508
509 bool enable_local_sync_backend = false; 509 bool enable_local_sync_backend = false;
510 base::FilePath local_sync_backend_folder; 510 base::FilePath local_sync_backend_folder =
511 sync_prefs_.GetLocalSyncBackendDir();
511 #if defined(OS_WIN) 512 #if defined(OS_WIN)
512 enable_local_sync_backend = base::CommandLine::ForCurrentProcess()->HasSwitch( 513 enable_local_sync_backend = sync_prefs_.IsLocalSyncEnabled();
513 switches::kEnableLocalSyncBackend); 514 if (local_sync_backend_folder.empty()) {
514 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
515 switches::kLocalSyncBackendDir)) {
516 local_sync_backend_folder =
517 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
518 switches::kLocalSyncBackendDir);
519 } else {
520 // TODO(pastarmovj): Add DIR_ROAMING_USER_DATA to PathService to simplify 515 // TODO(pastarmovj): Add DIR_ROAMING_USER_DATA to PathService to simplify
521 // this code and move the logic in its right place. See crbug/657810. 516 // this code and move the logic in its right place. See crbug/657810.
522 CHECK( 517 CHECK(
523 base::PathService::Get(base::DIR_APP_DATA, &local_sync_backend_folder)); 518 base::PathService::Get(base::DIR_APP_DATA, &local_sync_backend_folder));
524 local_sync_backend_folder = 519 local_sync_backend_folder =
525 local_sync_backend_folder.Append(FILE_PATH_LITERAL("Chrome/User Data")); 520 local_sync_backend_folder.Append(FILE_PATH_LITERAL("Chrome/User Data"));
526 } 521 }
527 // This code as it is now will assume the same profile order is present on all 522 // This code as it is now will assume the same profile order is present on all
528 // machines, which is not a given. It is to be defined if only the Default 523 // machines, which is not a given. It is to be defined if only the Default
529 // profile should get this treatment or all profile as is the case now. The 524 // profile should get this treatment or all profile as is the case now. The
(...skipping 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after
2534 2529
2535 DCHECK(startup_controller_->IsSetupInProgress()); 2530 DCHECK(startup_controller_->IsSetupInProgress());
2536 startup_controller_->SetSetupInProgress(false); 2531 startup_controller_->SetSetupInProgress(false);
2537 2532
2538 if (IsBackendInitialized()) 2533 if (IsBackendInitialized())
2539 ReconfigureDatatypeManager(); 2534 ReconfigureDatatypeManager();
2540 NotifyObservers(); 2535 NotifyObservers();
2541 } 2536 }
2542 2537
2543 } // namespace browser_sync 2538 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/prefs/chrome_command_line_pref_store.cc ('k') | components/sync/base/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698