Index: chrome/browser/sync/profile_sync_components_factory_impl.cc |
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc |
index de90dd71e3c6f5a0d8b1b633bdcee1eeb5a24469..87a75e4f50e4a25b0f803bd7d6a91f5df816b26d 100644 |
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc |
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc |
@@ -51,6 +51,7 @@ |
#include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
#include "chrome/browser/sync/profile_sync_service.h" |
#include "chrome/browser/sync/profile_sync_service_factory.h" |
+#include "chrome/browser/sync/sessions2/session_data_type_controller2.h" |
#include "chrome/browser/themes/theme_service.h" |
#include "chrome/browser/themes/theme_service_factory.h" |
#include "chrome/browser/themes/theme_syncable_service.h" |
@@ -100,6 +101,7 @@ using browser_sync::ProxyDataTypeController; |
using browser_sync::SearchEngineDataTypeController; |
using browser_sync::SessionChangeProcessor; |
using browser_sync::SessionDataTypeController; |
+using browser_sync::SessionDataTypeController2; |
using browser_sync::SessionModelAssociator; |
using browser_sync::SharedChangeProcessor; |
using browser_sync::SyncBackendHost; |
@@ -172,10 +174,15 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( |
// Session sync is enabled by default. Register unless explicitly disabled. |
if (!command_line_->HasSwitch(switches::kDisableSyncTabs)) { |
- pss->RegisterDataTypeController( |
- new ProxyDataTypeController(syncer::PROXY_TABS)); |
- pss->RegisterDataTypeController( |
- new SessionDataTypeController(this, profile_, pss)); |
+ pss->RegisterDataTypeController( |
+ new ProxyDataTypeController(syncer::PROXY_TABS)); |
+ if (!command_line_->HasSwitch(switches::kEnableSyncSessionsV2)) { |
+ pss->RegisterDataTypeController( |
+ new SessionDataTypeController(this, profile_, pss)); |
+ } else { |
+ pss->RegisterDataTypeController( |
+ new SessionDataTypeController2(this, profile_, pss)); |
+ } |
} |
// Favicon sync is enabled by default. Register unless explicitly disabled. |
@@ -397,12 +404,11 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: |
#endif |
case syncer::FAVICON_IMAGES: |
case syncer::FAVICON_TRACKING: { |
- browser_sync::SessionModelAssociator* model_associator = |
+ browser_sync::FaviconCache* favicons = |
ProfileSyncServiceFactory::GetForProfile(profile_)-> |
- GetSessionModelAssociator(); |
- if (!model_associator) |
- return base::WeakPtr<syncer::SyncableService>(); |
- return model_associator->GetFaviconCache()->AsWeakPtr(); |
+ GetFaviconCache(); |
+ return favicons ? favicons->AsWeakPtr() |
+ : base::WeakPtr<syncer::SyncableService>(); |
} |
#if defined(ENABLE_MANAGED_USERS) |
case syncer::MANAGED_USER_SETTINGS: |
@@ -415,12 +421,15 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: |
case syncer::ARTICLES: |
// TODO(nyquist) Hook up real syncer::SyncableService API here. |
return base::WeakPtr<syncer::SyncableService>(); |
+ case syncer::SESSIONS: |
+ DCHECK(command_line_->HasSwitch(switches::kEnableSyncSessionsV2)); |
+ return ProfileSyncServiceFactory::GetForProfile(profile_)-> |
+ GetSessionsSyncableService()->AsWeakPtr(); |
default: |
// The following datatypes still need to be transitioned to the |
// syncer::SyncableService API: |
// Bookmarks |
// Passwords |
- // Sessions |
// Typed URLs |
NOTREACHED(); |
return base::WeakPtr<syncer::SyncableService>(); |