Chromium Code Reviews| Index: chrome/browser/sync/profile_sync_service.cc |
| diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc |
| index d031292bf282071751a9c027955f7b6ead203f3f..2f23731bcaa3f8543c9381600fe1d7ead75c7342 100644 |
| --- a/chrome/browser/sync/profile_sync_service.cc |
| +++ b/chrome/browser/sync/profile_sync_service.cc |
| @@ -414,7 +414,8 @@ void ProfileSyncService::InitializeBackend(bool delete_sync_data_folder) { |
| SyncCredentials credentials = GetCredentials(); |
| - backend_->Initialize(sync_service_url_, |
| + backend_->Initialize(this, |
| + sync_service_url_, |
| types, |
| profile_->GetRequestContext(), |
| credentials, |
| @@ -423,7 +424,7 @@ void ProfileSyncService::InitializeBackend(bool delete_sync_data_folder) { |
| } |
| void ProfileSyncService::CreateBackend() { |
| - backend_.reset(new SyncBackendHost(this, profile_)); |
| + backend_.reset(new SyncBackendHost(profile_)); |
| } |
| void ProfileSyncService::StartUp() { |
| @@ -1013,6 +1014,12 @@ bool ProfileSyncService::IsCryptographerReady() const { |
| return backend_.get() && backend_->IsCryptographerReady(); |
| } |
| +SyncBackendHost* ProfileSyncService::GetBackendForTest() { |
| + // We don't check |backend_initialized_|; we assume the test class |
| + // knows what it's doing. |
| + return backend_.get(); |
| +} |
| + |
| void ProfileSyncService::ConfigureDataTypeManager() { |
| if (!data_type_manager_.get()) { |
| data_type_manager_.reset( |
| @@ -1031,6 +1038,78 @@ void ProfileSyncService::ConfigureDataTypeManager() { |
| data_type_manager_->Configure(types); |
| } |
| +ProfileSyncService::UserShareHandle |
| + ProfileSyncService::GetUserShareHandle() const { |
| + if (backend_.get() && backend_initialized_) { |
| + return backend_->GetUserShareHandle(); |
| + } |
| + NOTREACHED(); |
| + return NULL; |
| +} |
| + |
| +const browser_sync::sessions::SyncSessionSnapshot* |
| + ProfileSyncService::GetLastSessionSnapshot() const { |
| + if (backend_.get() && backend_initialized_) { |
| + return backend_->GetLastSessionSnapshot(); |
| + } |
| + NOTREACHED(); |
| + return NULL; |
| +} |
| + |
| +bool ProfileSyncService::HasUnsyncedItems() const { |
| + if (backend_.get() && backend_initialized_) { |
| + return backend_->HasUnsyncedItems(); |
| + } |
| + NOTREACHED(); |
| + return false; |
| +} |
| + |
| +void ProfileSyncService::GetModelSafeRoutingInfo( |
| + browser_sync::ModelSafeRoutingInfo* out) { |
| + if (backend_.get() && backend_initialized_) { |
| + backend_->GetModelSafeRoutingInfo(out); |
|
tim (not reviewing)
2011/01/21 18:17:00
return; ?
akalin
2011/01/21 21:21:09
Done.
|
| + } |
| + NOTREACHED(); |
| +} |
| + |
| +syncable::AutofillMigrationState |
| + ProfileSyncService::GetAutofillMigrationState() { |
| + if (backend_.get() && backend_initialized_) { |
| + return backend_->GetAutofillMigrationState(); |
| + } |
| + NOTREACHED(); |
| + return syncable::NOT_DETERMINED; |
| +} |
| + |
| +void ProfileSyncService::SetAutofillMigrationState( |
| + syncable::AutofillMigrationState state) { |
| + if (backend_.get() && backend_initialized_) { |
| + backend_->SetAutofillMigrationState(state); |
| + } else { |
| + NOTREACHED(); |
| + } |
| +} |
| + |
| +syncable::AutofillMigrationDebugInfo |
| + ProfileSyncService::GetAutofillMigrationDebugInfo() { |
| + if (backend_.get() && backend_initialized_) { |
| + return backend_->GetAutofillMigrationDebugInfo(); |
| + } |
| + NOTREACHED(); |
| + syncable::AutofillMigrationDebugInfo debug_info = { 0 }; |
| + return debug_info; |
| +} |
| + |
| +void ProfileSyncService::SetAutofillMigrationDebugInfo( |
| + syncable::AutofillMigrationDebugInfo::PropertyToSet property_to_set, |
| + const syncable::AutofillMigrationDebugInfo& info) { |
| + if (backend_.get() && backend_initialized_) { |
| + backend_->SetAutofillMigrationDebugInfo(property_to_set, info); |
| + } else { |
| + NOTREACHED(); |
| + } |
| +} |
| + |
| void ProfileSyncService::ActivateDataType( |
| DataTypeController* data_type_controller, |
| ChangeProcessor* change_processor) { |