OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/logging.h" | 6 #include "base/logging.h" |
7 #include "chrome/browser/defaults.h" | 7 #include "chrome/browser/defaults.h" |
8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
9 #include "chrome/browser/sync/glue/autofill_change_processor.h" | 9 #include "chrome/browser/sync/glue/autofill_change_processor.h" |
10 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" | 10 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 using browser_sync::PreferenceModelAssociator; | 54 using browser_sync::PreferenceModelAssociator; |
55 using browser_sync::SyncBackendHost; | 55 using browser_sync::SyncBackendHost; |
56 using browser_sync::ThemeChangeProcessor; | 56 using browser_sync::ThemeChangeProcessor; |
57 using browser_sync::ThemeDataTypeController; | 57 using browser_sync::ThemeDataTypeController; |
58 using browser_sync::ThemeModelAssociator; | 58 using browser_sync::ThemeModelAssociator; |
59 using browser_sync::TypedUrlChangeProcessor; | 59 using browser_sync::TypedUrlChangeProcessor; |
60 using browser_sync::TypedUrlDataTypeController; | 60 using browser_sync::TypedUrlDataTypeController; |
61 using browser_sync::TypedUrlModelAssociator; | 61 using browser_sync::TypedUrlModelAssociator; |
62 using browser_sync::UnrecoverableErrorHandler; | 62 using browser_sync::UnrecoverableErrorHandler; |
63 | 63 |
64 ProfileSyncFactoryImpl::ProfileSyncFactoryImpl( | 64 ProfileSyncFactoryImpl::ProfileSyncFactoryImpl(Profile* profile, |
65 Profile* profile, | 65 CommandLine* command_line) |
66 chrome_common_net::NetworkChangeNotifierThread* | |
67 network_change_notifier_thread, | |
68 CommandLine* command_line) | |
69 : profile_(profile), | 66 : profile_(profile), |
70 network_change_notifier_thread_(network_change_notifier_thread), | |
71 command_line_(command_line) { | 67 command_line_(command_line) { |
72 DCHECK(network_change_notifier_thread_); | |
73 } | 68 } |
74 | 69 |
75 ProfileSyncService* ProfileSyncFactoryImpl::CreateProfileSyncService() { | 70 ProfileSyncService* ProfileSyncFactoryImpl::CreateProfileSyncService() { |
76 ProfileSyncService* pss = | 71 ProfileSyncService* pss = new ProfileSyncService( |
77 new ProfileSyncService(this, | 72 this, profile_, browser_defaults::kBootstrapSyncAuthentication); |
78 profile_, | |
79 network_change_notifier_thread_, | |
80 browser_defaults::kBootstrapSyncAuthentication); | |
81 | 73 |
82 // Autofill sync is enabled by default. Register unless explicitly | 74 // Autofill sync is enabled by default. Register unless explicitly |
83 // disabled. | 75 // disabled. |
84 if (!command_line_->HasSwitch(switches::kDisableSyncAutofill)) { | 76 if (!command_line_->HasSwitch(switches::kDisableSyncAutofill)) { |
85 pss->RegisterDataTypeController( | 77 pss->RegisterDataTypeController( |
86 new AutofillDataTypeController(this, profile_, pss)); | 78 new AutofillDataTypeController(this, profile_, pss)); |
87 } | 79 } |
88 | 80 |
89 // Bookmark sync is enabled by default. Register unless explicitly | 81 // Bookmark sync is enabled by default. Register unless explicitly |
90 // disabled. | 82 // disabled. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 browser_sync::UnrecoverableErrorHandler* error_handler) { | 215 browser_sync::UnrecoverableErrorHandler* error_handler) { |
224 TypedUrlModelAssociator* model_associator = | 216 TypedUrlModelAssociator* model_associator = |
225 new TypedUrlModelAssociator(profile_sync_service, | 217 new TypedUrlModelAssociator(profile_sync_service, |
226 history_backend); | 218 history_backend); |
227 TypedUrlChangeProcessor* change_processor = | 219 TypedUrlChangeProcessor* change_processor = |
228 new TypedUrlChangeProcessor(model_associator, | 220 new TypedUrlChangeProcessor(model_associator, |
229 history_backend, | 221 history_backend, |
230 error_handler); | 222 error_handler); |
231 return SyncComponents(model_associator, change_processor); | 223 return SyncComponents(model_associator, change_processor); |
232 } | 224 } |
OLD | NEW |