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" |
11 #include "chrome/browser/extensions/extension_system.h" | 11 #include "chrome/browser/extensions/extension_system.h" |
12 #include "chrome/browser/extensions/extension_system_factory.h" | 12 #include "chrome/browser/extensions/extension_system_factory.h" |
13 #include "chrome/browser/history/history_service.h" | 13 #include "chrome/browser/history/history_service.h" |
14 #include "chrome/browser/history/history_service_factory.h" | 14 #include "chrome/browser/history/history_service_factory.h" |
15 #include "chrome/browser/prefs/pref_model_associator.h" | 15 #include "chrome/browser/prefs/pref_model_associator.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service_syncable.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/search_engines/template_url_service.h" | 18 #include "chrome/browser/search_engines/template_url_service.h" |
19 #include "chrome/browser/search_engines/template_url_service_factory.h" | 19 #include "chrome/browser/search_engines/template_url_service_factory.h" |
20 #include "chrome/browser/signin/signin_manager.h" | 20 #include "chrome/browser/signin/signin_manager.h" |
21 #include "chrome/browser/signin/signin_manager_factory.h" | 21 #include "chrome/browser/signin/signin_manager_factory.h" |
22 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 22 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
23 #include "chrome/browser/spellchecker/spellcheck_service.h" | 23 #include "chrome/browser/spellchecker/spellcheck_service.h" |
24 #include "chrome/browser/sync/glue/app_notification_data_type_controller.h" | 24 #include "chrome/browser/sync/glue/app_notification_data_type_controller.h" |
25 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" | 25 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" |
26 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" | 26 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 return new SharedChangeProcessor(); | 278 return new SharedChangeProcessor(); |
279 } | 279 } |
280 | 280 |
281 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: | 281 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: |
282 GetSyncableServiceForType(syncer::ModelType type) { | 282 GetSyncableServiceForType(syncer::ModelType type) { |
283 if (!profile_) { // For tests. | 283 if (!profile_) { // For tests. |
284 return base::WeakPtr<syncer::SyncableService>(); | 284 return base::WeakPtr<syncer::SyncableService>(); |
285 } | 285 } |
286 switch (type) { | 286 switch (type) { |
287 case syncer::PREFERENCES: | 287 case syncer::PREFERENCES: |
288 return profile_->GetPrefs()->GetSyncableService()->AsWeakPtr(); | 288 return PrefServiceSyncable::FromProfile( |
| 289 profile_)->GetSyncableService()->AsWeakPtr(); |
289 case syncer::AUTOFILL: | 290 case syncer::AUTOFILL: |
290 case syncer::AUTOFILL_PROFILE: { | 291 case syncer::AUTOFILL_PROFILE: { |
291 if (!web_data_service_.get()) | 292 if (!web_data_service_.get()) |
292 return base::WeakPtr<syncer::SyncableService>(); | 293 return base::WeakPtr<syncer::SyncableService>(); |
293 if (type == syncer::AUTOFILL) { | 294 if (type == syncer::AUTOFILL) { |
294 return web_data_service_->GetAutocompleteSyncableService()->AsWeakPtr(); | 295 return web_data_service_->GetAutocompleteSyncableService()->AsWeakPtr(); |
295 } else { | 296 } else { |
296 return web_data_service_-> | 297 return web_data_service_-> |
297 GetAutofillProfileSyncableService()->AsWeakPtr(); | 298 GetAutofillProfileSyncableService()->AsWeakPtr(); |
298 } | 299 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 ProfileSyncComponentsFactory::SyncComponents | 396 ProfileSyncComponentsFactory::SyncComponents |
396 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 397 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
397 ProfileSyncService* profile_sync_service, | 398 ProfileSyncService* profile_sync_service, |
398 DataTypeErrorHandler* error_handler) { | 399 DataTypeErrorHandler* error_handler) { |
399 SessionModelAssociator* model_associator = | 400 SessionModelAssociator* model_associator = |
400 new SessionModelAssociator(profile_sync_service, error_handler); | 401 new SessionModelAssociator(profile_sync_service, error_handler); |
401 SessionChangeProcessor* change_processor = | 402 SessionChangeProcessor* change_processor = |
402 new SessionChangeProcessor(error_handler, model_associator); | 403 new SessionChangeProcessor(error_handler, model_associator); |
403 return SyncComponents(model_associator, change_processor); | 404 return SyncComponents(model_associator, change_processor); |
404 } | 405 } |
OLD | NEW |