Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7570)

Unified Diff: chrome/browser/sync/profile_sync_components_factory_impl.cc

Issue 74653002: sync: Add --enable-sync-sessions-v2 and necessary plumbing to use SessionsSyncManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/open_tabs_ui_delegate.cc ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>();
« no previous file with comments | « chrome/browser/sync/open_tabs_ui_delegate.cc ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698