OLD | NEW |
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 "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 if (experiments.enhanced_bookmarks_enabled) { | 1097 if (experiments.enhanced_bookmarks_enabled) { |
1098 profile_->GetPrefs()->SetString( | 1098 profile_->GetPrefs()->SetString( |
1099 sync_driver::prefs::kEnhancedBookmarksExtensionId, | 1099 sync_driver::prefs::kEnhancedBookmarksExtensionId, |
1100 experiments.enhanced_bookmarks_ext_id); | 1100 experiments.enhanced_bookmarks_ext_id); |
1101 } else { | 1101 } else { |
1102 profile_->GetPrefs()->ClearPref( | 1102 profile_->GetPrefs()->ClearPref( |
1103 sync_driver::prefs::kEnhancedBookmarksExtensionId); | 1103 sync_driver::prefs::kEnhancedBookmarksExtensionId); |
1104 } | 1104 } |
1105 UpdateBookmarksExperimentState( | 1105 UpdateBookmarksExperimentState( |
1106 profile_->GetPrefs(), g_browser_process->local_state(), true, | 1106 profile_->GetPrefs(), g_browser_process->local_state(), true, |
1107 experiments.enhanced_bookmarks_enabled ? kBookmarksExperimentEnabled : | 1107 experiments.enhanced_bookmarks_enabled ? BOOKMARKS_EXPERIMENT_ENABLED : |
1108 kNoBookmarksExperiment); | 1108 BOOKMARKS_EXPERIMENT_NONE); |
1109 | 1109 |
1110 // If this is a first time sync for a client, this will be called before | 1110 // If this is a first time sync for a client, this will be called before |
1111 // OnBackendInitialized() to ensure the new datatypes are available at sync | 1111 // OnBackendInitialized() to ensure the new datatypes are available at sync |
1112 // setup. As a result, the migrator won't exist yet. This is fine because for | 1112 // setup. As a result, the migrator won't exist yet. This is fine because for |
1113 // first time sync cases we're only concerned with making the datatype | 1113 // first time sync cases we're only concerned with making the datatype |
1114 // available. | 1114 // available. |
1115 if (migrator_.get() && | 1115 if (migrator_.get() && |
1116 migrator_->state() != browser_sync::BackendMigrator::IDLE) { | 1116 migrator_->state() != browser_sync::BackendMigrator::IDLE) { |
1117 DVLOG(1) << "Dropping OnExperimentsChanged due to migrator busy."; | 1117 DVLOG(1) << "Dropping OnExperimentsChanged due to migrator busy."; |
1118 return; | 1118 return; |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 network_resources_ = network_resources.Pass(); | 2468 network_resources_ = network_resources.Pass(); |
2469 } | 2469 } |
2470 | 2470 |
2471 bool ProfileSyncService::HasSyncingBackend() const { | 2471 bool ProfileSyncService::HasSyncingBackend() const { |
2472 return backend_mode_ != SYNC ? false : backend_ != NULL; | 2472 return backend_mode_ != SYNC ? false : backend_ != NULL; |
2473 } | 2473 } |
2474 | 2474 |
2475 void ProfileSyncService::SetBackupStartDelayForTest(base::TimeDelta delay) { | 2475 void ProfileSyncService::SetBackupStartDelayForTest(base::TimeDelta delay) { |
2476 backup_start_delay_ = delay; | 2476 backup_start_delay_ = delay; |
2477 } | 2477 } |
OLD | NEW |