| 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/bookmarks/enhanced_bookmarks_features.h" | 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
| 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 10 #include "chrome/browser/history/history_service.h" | 10 #include "chrome/browser/history/history_service.h" |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 if (service) | 524 if (service) |
| 525 return service->GetSyncableService()->AsWeakPtr(); | 525 return service->GetSyncableService()->AsWeakPtr(); |
| 526 return base::WeakPtr<syncer::SyncableService>(); | 526 return base::WeakPtr<syncer::SyncableService>(); |
| 527 } | 527 } |
| 528 case syncer::SESSIONS: { | 528 case syncer::SESSIONS: { |
| 529 return ProfileSyncServiceFactory::GetForProfile(profile_)-> | 529 return ProfileSyncServiceFactory::GetForProfile(profile_)-> |
| 530 GetSessionsSyncableService()->AsWeakPtr(); | 530 GetSessionsSyncableService()->AsWeakPtr(); |
| 531 } | 531 } |
| 532 case syncer::PASSWORDS: { | 532 case syncer::PASSWORDS: { |
| 533 #if defined(PASSWORD_MANAGER_ENABLE_SYNC) | 533 #if defined(PASSWORD_MANAGER_ENABLE_SYNC) |
| 534 password_manager::PasswordStore* password_store = | 534 scoped_refptr<password_manager::PasswordStore> password_store = |
| 535 PasswordStoreFactory::GetForProfile(profile_, | 535 PasswordStoreFactory::GetForProfile(profile_, |
| 536 Profile::EXPLICIT_ACCESS); | 536 Profile::EXPLICIT_ACCESS); |
| 537 return password_store ? password_store->GetPasswordSyncableService() | 537 return password_store.get() ? password_store->GetPasswordSyncableService() |
| 538 : base::WeakPtr<syncer::SyncableService>(); | 538 : base::WeakPtr<syncer::SyncableService>(); |
| 539 #else | 539 #else |
| 540 return base::WeakPtr<syncer::SyncableService>(); | 540 return base::WeakPtr<syncer::SyncableService>(); |
| 541 #endif | 541 #endif |
| 542 } | 542 } |
| 543 default: | 543 default: |
| 544 // The following datatypes still need to be transitioned to the | 544 // The following datatypes still need to be transitioned to the |
| 545 // syncer::SyncableService API: | 545 // syncer::SyncableService API: |
| 546 // Bookmarks | 546 // Bookmarks |
| 547 // Typed URLs | 547 // Typed URLs |
| 548 NOTREACHED(); | 548 NOTREACHED(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 new TypedUrlModelAssociator(profile_sync_service, | 674 new TypedUrlModelAssociator(profile_sync_service, |
| 675 history_backend, | 675 history_backend, |
| 676 error_handler); | 676 error_handler); |
| 677 TypedUrlChangeProcessor* change_processor = | 677 TypedUrlChangeProcessor* change_processor = |
| 678 new TypedUrlChangeProcessor(profile_, | 678 new TypedUrlChangeProcessor(profile_, |
| 679 model_associator, | 679 model_associator, |
| 680 history_backend, | 680 history_backend, |
| 681 error_handler); | 681 error_handler); |
| 682 return SyncComponents(model_associator, change_processor); | 682 return SyncComponents(model_associator, change_processor); |
| 683 } | 683 } |
| OLD | NEW |