| 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/api/webdata/autofill_web_data_service.h" | 7 #include "chrome/browser/api/webdata/autofill_web_data_service.h" | 
| 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 
| 9 #include "chrome/browser/extensions/api/storage/settings_frontend.h" | 9 #include "chrome/browser/extensions/api/storage/settings_frontend.h" | 
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" | 
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 199     pss->RegisterDataTypeController( | 199     pss->RegisterDataTypeController( | 
| 200         new ExtensionDataTypeController(syncer::EXTENSIONS, | 200         new ExtensionDataTypeController(syncer::EXTENSIONS, | 
| 201                                         this, profile_, pss)); | 201                                         this, profile_, pss)); | 
| 202   } | 202   } | 
| 203 | 203 | 
| 204   // Preference sync is enabled by default.  Register unless explicitly | 204   // Preference sync is enabled by default.  Register unless explicitly | 
| 205   // disabled. | 205   // disabled. | 
| 206   if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { | 206   if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { | 
| 207     pss->RegisterDataTypeController( | 207     pss->RegisterDataTypeController( | 
| 208         new UIDataTypeController(syncer::PREFERENCES, this, profile_, pss)); | 208         new UIDataTypeController(syncer::PREFERENCES, this, profile_, pss)); | 
|  | 209 | 
|  | 210   } | 
|  | 211 | 
|  | 212   if (!command_line_->HasSwitch(switches::kDisableSyncPriorityPreferences)) { | 
|  | 213     pss->RegisterDataTypeController( | 
|  | 214         new UIDataTypeController(syncer::PRIORITY_PREFERENCES, | 
|  | 215                                  this, profile_, pss)); | 
| 209   } | 216   } | 
| 210 | 217 | 
| 211 #if defined(ENABLE_THEMES) | 218 #if defined(ENABLE_THEMES) | 
| 212   // Theme sync is enabled by default.  Register unless explicitly disabled. | 219   // Theme sync is enabled by default.  Register unless explicitly disabled. | 
| 213   if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { | 220   if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { | 
| 214     pss->RegisterDataTypeController( | 221     pss->RegisterDataTypeController( | 
| 215         new ThemeDataTypeController(this, profile_, pss)); | 222         new ThemeDataTypeController(this, profile_, pss)); | 
| 216   } | 223   } | 
| 217 #endif | 224 #endif | 
| 218 | 225 | 
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 295 } | 302 } | 
| 296 | 303 | 
| 297 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: | 304 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: | 
| 298     GetSyncableServiceForType(syncer::ModelType type) { | 305     GetSyncableServiceForType(syncer::ModelType type) { | 
| 299   if (!profile_) {  // For tests. | 306   if (!profile_) {  // For tests. | 
| 300      return base::WeakPtr<syncer::SyncableService>(); | 307      return base::WeakPtr<syncer::SyncableService>(); | 
| 301   } | 308   } | 
| 302   switch (type) { | 309   switch (type) { | 
| 303     case syncer::PREFERENCES: | 310     case syncer::PREFERENCES: | 
| 304       return PrefServiceSyncable::FromProfile( | 311       return PrefServiceSyncable::FromProfile( | 
| 305           profile_)->GetSyncableService()->AsWeakPtr(); | 312           profile_)->GetSyncableService(syncer::PREFERENCES)->AsWeakPtr(); | 
|  | 313     case syncer::PRIORITY_PREFERENCES: | 
|  | 314       return PrefServiceSyncable::FromProfile(profile_)->GetSyncableService( | 
|  | 315           syncer::PRIORITY_PREFERENCES)->AsWeakPtr(); | 
| 306     case syncer::AUTOFILL: | 316     case syncer::AUTOFILL: | 
| 307     case syncer::AUTOFILL_PROFILE: { | 317     case syncer::AUTOFILL_PROFILE: { | 
| 308       if (!web_data_service_.get()) | 318       if (!web_data_service_.get()) | 
| 309         return base::WeakPtr<syncer::SyncableService>(); | 319         return base::WeakPtr<syncer::SyncableService>(); | 
| 310       if (type == syncer::AUTOFILL) { | 320       if (type == syncer::AUTOFILL) { | 
| 311         return AutocompleteSyncableService::FromWebDataService( | 321         return AutocompleteSyncableService::FromWebDataService( | 
| 312             web_data_service_)->AsWeakPtr(); | 322             web_data_service_)->AsWeakPtr(); | 
| 313       } else { | 323       } else { | 
| 314         return AutofillProfileSyncableService::FromWebDataService( | 324         return AutofillProfileSyncableService::FromWebDataService( | 
| 315             web_data_service_)->AsWeakPtr(); | 325             web_data_service_)->AsWeakPtr(); | 
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 423 ProfileSyncComponentsFactory::SyncComponents | 433 ProfileSyncComponentsFactory::SyncComponents | 
| 424     ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 434     ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 
| 425        ProfileSyncService* profile_sync_service, | 435        ProfileSyncService* profile_sync_service, | 
| 426         DataTypeErrorHandler* error_handler) { | 436         DataTypeErrorHandler* error_handler) { | 
| 427   SessionModelAssociator* model_associator = | 437   SessionModelAssociator* model_associator = | 
| 428       new SessionModelAssociator(profile_sync_service, error_handler); | 438       new SessionModelAssociator(profile_sync_service, error_handler); | 
| 429   SessionChangeProcessor* change_processor = | 439   SessionChangeProcessor* change_processor = | 
| 430       new SessionChangeProcessor(error_handler, model_associator); | 440       new SessionChangeProcessor(error_handler, model_associator); | 
| 431   return SyncComponents(model_associator, change_processor); | 441   return SyncComponents(model_associator, change_processor); | 
| 432 } | 442 } | 
| OLD | NEW | 
|---|