| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 8 #include "chrome/browser/extensions/api/storage/settings_frontend.h" | 8 #include "chrome/browser/extensions/api/storage/settings_frontend.h" |
| 9 #include "chrome/browser/extensions/app_notification_manager.h" | 9 #include "chrome/browser/extensions/app_notification_manager.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 pss->RegisterDataTypeController( | 184 pss->RegisterDataTypeController( |
| 185 new ExtensionDataTypeController(syncer::EXTENSIONS, | 185 new ExtensionDataTypeController(syncer::EXTENSIONS, |
| 186 this, profile_, pss)); | 186 this, profile_, pss)); |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Preference sync is enabled by default. Register unless explicitly | 189 // Preference sync is enabled by default. Register unless explicitly |
| 190 // disabled. | 190 // disabled. |
| 191 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { | 191 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { |
| 192 pss->RegisterDataTypeController( | 192 pss->RegisterDataTypeController( |
| 193 new UIDataTypeController(syncer::PREFERENCES, this, profile_, pss)); | 193 new UIDataTypeController(syncer::PREFERENCES, this, profile_, pss)); |
| 194 pss->RegisterDataTypeController( |
| 195 new UIDataTypeController(syncer::PRIORITY_PREFERENCES, |
| 196 this, profile_, pss)); |
| 194 } | 197 } |
| 195 | 198 |
| 196 #if defined(ENABLE_THEMES) | 199 #if defined(ENABLE_THEMES) |
| 197 // Theme sync is enabled by default. Register unless explicitly disabled. | 200 // Theme sync is enabled by default. Register unless explicitly disabled. |
| 198 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { | 201 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { |
| 199 pss->RegisterDataTypeController( | 202 pss->RegisterDataTypeController( |
| 200 new ThemeDataTypeController(this, profile_, pss)); | 203 new ThemeDataTypeController(this, profile_, pss)); |
| 201 } | 204 } |
| 202 #endif | 205 #endif |
| 203 | 206 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 298 |
| 296 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: | 299 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: |
| 297 GetSyncableServiceForType(syncer::ModelType type) { | 300 GetSyncableServiceForType(syncer::ModelType type) { |
| 298 if (!profile_) { // For tests. | 301 if (!profile_) { // For tests. |
| 299 return base::WeakPtr<syncer::SyncableService>(); | 302 return base::WeakPtr<syncer::SyncableService>(); |
| 300 } | 303 } |
| 301 switch (type) { | 304 switch (type) { |
| 302 case syncer::PREFERENCES: | 305 case syncer::PREFERENCES: |
| 303 return PrefServiceSyncable::FromProfile( | 306 return PrefServiceSyncable::FromProfile( |
| 304 profile_)->GetSyncableService()->AsWeakPtr(); | 307 profile_)->GetSyncableService()->AsWeakPtr(); |
| 308 case syncer::PRIORITY_PREFERENCES: |
| 309 return PrefServiceSyncable::FromProfile( |
| 310 profile_)->GetPrioritySyncableService()->AsWeakPtr(); |
| 305 case syncer::AUTOFILL: | 311 case syncer::AUTOFILL: |
| 306 case syncer::AUTOFILL_PROFILE: { | 312 case syncer::AUTOFILL_PROFILE: { |
| 307 if (!web_data_service_.get()) | 313 if (!web_data_service_.get()) |
| 308 return base::WeakPtr<syncer::SyncableService>(); | 314 return base::WeakPtr<syncer::SyncableService>(); |
| 309 if (type == syncer::AUTOFILL) { | 315 if (type == syncer::AUTOFILL) { |
| 310 return web_data_service_->GetAutocompleteSyncableService()->AsWeakPtr(); | 316 return web_data_service_->GetAutocompleteSyncableService()->AsWeakPtr(); |
| 311 } else { | 317 } else { |
| 312 return web_data_service_-> | 318 return web_data_service_-> |
| 313 GetAutofillProfileSyncableService()->AsWeakPtr(); | 319 GetAutofillProfileSyncableService()->AsWeakPtr(); |
| 314 } | 320 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 ProfileSyncComponentsFactory::SyncComponents | 429 ProfileSyncComponentsFactory::SyncComponents |
| 424 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 430 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
| 425 ProfileSyncService* profile_sync_service, | 431 ProfileSyncService* profile_sync_service, |
| 426 DataTypeErrorHandler* error_handler) { | 432 DataTypeErrorHandler* error_handler) { |
| 427 SessionModelAssociator* model_associator = | 433 SessionModelAssociator* model_associator = |
| 428 new SessionModelAssociator(profile_sync_service, error_handler); | 434 new SessionModelAssociator(profile_sync_service, error_handler); |
| 429 SessionChangeProcessor* change_processor = | 435 SessionChangeProcessor* change_processor = |
| 430 new SessionChangeProcessor(error_handler, model_associator); | 436 new SessionChangeProcessor(error_handler, model_associator); |
| 431 return SyncComponents(model_associator, change_processor); | 437 return SyncComponents(model_associator, change_processor); |
| 432 } | 438 } |
| OLD | NEW |