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/app_data_type_controller.h" | 9 #include "chrome/browser/sync/glue/app_data_type_controller.h" |
10 #include "chrome/browser/sync/glue/autofill_change_processor.h" | 10 #include "chrome/browser/sync/glue/autofill_change_processor.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 using browser_sync::TypedUrlDataTypeController; | 69 using browser_sync::TypedUrlDataTypeController; |
70 using browser_sync::TypedUrlModelAssociator; | 70 using browser_sync::TypedUrlModelAssociator; |
71 using browser_sync::UnrecoverableErrorHandler; | 71 using browser_sync::UnrecoverableErrorHandler; |
72 | 72 |
73 ProfileSyncFactoryImpl::ProfileSyncFactoryImpl(Profile* profile, | 73 ProfileSyncFactoryImpl::ProfileSyncFactoryImpl(Profile* profile, |
74 CommandLine* command_line) | 74 CommandLine* command_line) |
75 : profile_(profile), | 75 : profile_(profile), |
76 command_line_(command_line) { | 76 command_line_(command_line) { |
77 } | 77 } |
78 | 78 |
79 ProfileSyncService* ProfileSyncFactoryImpl::CreateProfileSyncService() { | 79 ProfileSyncService* ProfileSyncFactoryImpl::CreateProfileSyncService( |
| 80 const std::string& cros_user) { |
| 81 |
80 ProfileSyncService* pss = new ProfileSyncService( | 82 ProfileSyncService* pss = new ProfileSyncService( |
81 this, profile_, browser_defaults::kBootstrapSyncAuthentication); | 83 this, profile_, cros_user); |
82 | 84 |
83 // App sync is enabled by default. Register unless explicitly | 85 // App sync is enabled by default. Register unless explicitly |
84 // disabled. | 86 // disabled. |
85 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { | 87 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { |
86 pss->RegisterDataTypeController( | 88 pss->RegisterDataTypeController( |
87 new AppDataTypeController(this, profile_, pss)); | 89 new AppDataTypeController(this, profile_, pss)); |
88 } | 90 } |
89 | 91 |
90 // Autofill sync is enabled by default. Register unless explicitly | 92 // Autofill sync is enabled by default. Register unless explicitly |
91 // disabled. | 93 // disabled. |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 ProfileSyncFactoryImpl::CreateSessionSyncComponents( | 268 ProfileSyncFactoryImpl::CreateSessionSyncComponents( |
267 ProfileSyncService* profile_sync_service, | 269 ProfileSyncService* profile_sync_service, |
268 UnrecoverableErrorHandler* error_handler) { | 270 UnrecoverableErrorHandler* error_handler) { |
269 SessionModelAssociator* model_associator = | 271 SessionModelAssociator* model_associator = |
270 new SessionModelAssociator(profile_sync_service); | 272 new SessionModelAssociator(profile_sync_service); |
271 SessionChangeProcessor* change_processor = | 273 SessionChangeProcessor* change_processor = |
272 new SessionChangeProcessor(error_handler, model_associator); | 274 new SessionChangeProcessor(error_handler, model_associator); |
273 return SyncComponents(model_associator, change_processor); | 275 return SyncComponents(model_associator, change_processor); |
274 } | 276 } |
275 | 277 |
OLD | NEW |