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

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

Issue 394223002: Disable tab syncing when history saving is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed remaining comments; Created 6 years, 4 months 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
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 aa16e7eefa68d5ac2780a129d785b2e295fbcf56..2b7eb335ceec2c82faefa46546698c61665274cf 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -204,10 +204,11 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes(
new BookmarkDataTypeController(this, profile_, pss));
}
+ const bool history_disabled =
+ profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled);
// TypedUrl sync is enabled by default. Register unless explicitly disabled,
// or if saving history is disabled.
- if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) &&
- !disabled_types.Has(syncer::TYPED_URLS)) {
+ if (!disabled_types.Has(syncer::TYPED_URLS) && !history_disabled) {
pss->RegisterDataTypeController(
new TypedUrlDataTypeController(this, profile_, pss));
}
@@ -224,7 +225,9 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes(
}
// Session sync is enabled by default. Register unless explicitly disabled.
- if (!disabled_types.Has(syncer::PROXY_TABS)) {
+ // This is also disabled if the browser history is disabled, because the
+ // tab sync data is added to the web history on the server.
+ if (!disabled_types.Has(syncer::PROXY_TABS) && !history_disabled) {
pss->RegisterDataTypeController(new ProxyDataTypeController(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
syncer::PROXY_TABS));

Powered by Google App Engine
This is Rietveld 408576698