Chromium Code Reviews| 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 5c17fb0f3e3c01b4bd833b558a4d80e13bc5a721..02bcfbace03d406a3779950b834f4e288a2ee76d 100644 |
| --- a/chrome/browser/sync/profile_sync_service.cc |
| +++ b/chrome/browser/sync/profile_sync_service.cc |
| @@ -824,6 +824,7 @@ void ProfileSyncService::OnBackendInitialized( |
| if (HasSyncSetupCompleted()) { |
| ConfigureDataTypeManager(); |
| + ConfigurePriorityDataTypes(); |
|
Nicolas Zea
2013/03/05 01:15:44
this should be before the normal types
albertb
2013/03/15 21:08:45
Done.
|
| } else { |
| DCHECK(FirstSetupInProgress()); |
| } |
| @@ -1268,6 +1269,7 @@ void ProfileSyncService::SetSetupInProgress(bool setup_in_progress) { |
| setup_in_progress_ = setup_in_progress; |
| if (!setup_in_progress && was_in_progress) { |
| if (sync_initialized()) { |
| + ConfigurePriorityDataTypes(); |
| ReconfigureDatatypeManager(); |
| } |
| } |
| @@ -1411,6 +1413,7 @@ void ProfileSyncService::ChangePreferredDataTypes( |
| ReconfigureDatatypeManager(); |
| } |
| +// TODO(albertb): Extract a common method. |
| syncer::ModelTypeSet ProfileSyncService::GetPreferredDataTypes() const { |
| const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes(); |
| const syncer::ModelTypeSet preferred_types = |
| @@ -1457,6 +1460,13 @@ SyncBackendHost* ProfileSyncService::GetBackendForTest() { |
| return backend_.get(); |
| } |
| +void ProfileSyncService::ConfigurePriorityDataTypes() { |
| + const syncer::ModelTypeSet priority_types = |
| + Intersection(GetPreferredDataTypes(), syncer::PriorityUserTypes()); |
| + data_type_manager_->Configure(priority_types, |
| + syncer::CONFIGURE_REASON_RECONFIGURATION); |
| +} |
| + |
| void ProfileSyncService::ConfigureDataTypeManager() { |
| // Don't configure datatypes if the setup UI is still on the screen - this |
| // is to help multi-screen setting UIs (like iOS) where they don't want to |