| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/sync/chrome_sync_client.h" | 5 #include "chrome/browser/sync/chrome_sync_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 #endif | 418 #endif |
| 419 default: | 419 default: |
| 420 // The following datatypes still need to be transitioned to the | 420 // The following datatypes still need to be transitioned to the |
| 421 // syncer::SyncableService API: | 421 // syncer::SyncableService API: |
| 422 // Bookmarks | 422 // Bookmarks |
| 423 NOTREACHED(); | 423 NOTREACHED(); |
| 424 return base::WeakPtr<syncer::SyncableService>(); | 424 return base::WeakPtr<syncer::SyncableService>(); |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 syncer_v2::ModelTypeService* ChromeSyncClient::GetModelTypeServiceForType( | 428 base::WeakPtr<syncer_v2::ModelTypeService> |
| 429 syncer::ModelType type) { | 429 ChromeSyncClient::GetModelTypeServiceForType(syncer::ModelType type) { |
| 430 switch (type) { | 430 switch (type) { |
| 431 case syncer::DEVICE_INFO: | 431 case syncer::DEVICE_INFO: |
| 432 return ProfileSyncServiceFactory::GetForProfile(profile_) | 432 return ProfileSyncServiceFactory::GetForProfile(profile_) |
| 433 ->GetDeviceInfoService(); | 433 ->GetDeviceInfoService() |
| 434 ->AsWeakPtr(); |
| 434 default: | 435 default: |
| 435 NOTREACHED(); | 436 NOTREACHED(); |
| 436 return nullptr; | 437 return base::WeakPtr<syncer_v2::ModelTypeService>(); |
| 437 } | 438 } |
| 438 } | 439 } |
| 439 | 440 |
| 440 scoped_refptr<syncer::ModelSafeWorker> | 441 scoped_refptr<syncer::ModelSafeWorker> |
| 441 ChromeSyncClient::CreateModelWorkerForGroup( | 442 ChromeSyncClient::CreateModelWorkerForGroup( |
| 442 syncer::ModelSafeGroup group, | 443 syncer::ModelSafeGroup group, |
| 443 syncer::WorkerLoopDestructionObserver* observer) { | 444 syncer::WorkerLoopDestructionObserver* observer) { |
| 444 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 445 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 445 switch (group) { | 446 switch (group) { |
| 446 case syncer::GROUP_DB: | 447 case syncer::GROUP_DB: |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 sync_service->RegisterDataTypeController( | 620 sync_service->RegisterDataTypeController( |
| 620 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS, | 621 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS, |
| 621 error_callback, this, profile_)); | 622 error_callback, this, profile_)); |
| 622 sync_service->RegisterDataTypeController( | 623 sync_service->RegisterDataTypeController( |
| 623 new SupervisedUserSyncDataTypeController( | 624 new SupervisedUserSyncDataTypeController( |
| 624 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 625 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 625 #endif | 626 #endif |
| 626 } | 627 } |
| 627 | 628 |
| 628 } // namespace browser_sync | 629 } // namespace browser_sync |
| OLD | NEW |