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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 new AutofillProfileDataTypeController(this, profile_)); 197 new AutofillProfileDataTypeController(this, profile_));
198 } 198 }
199 199
200 // Bookmark sync is enabled by default. Register unless explicitly 200 // Bookmark sync is enabled by default. Register unless explicitly
201 // disabled. 201 // disabled.
202 if (!disabled_types.Has(syncer::BOOKMARKS)) { 202 if (!disabled_types.Has(syncer::BOOKMARKS)) {
203 pss->RegisterDataTypeController( 203 pss->RegisterDataTypeController(
204 new BookmarkDataTypeController(this, profile_, pss)); 204 new BookmarkDataTypeController(this, profile_, pss));
205 } 205 }
206 206
207 const bool history_disabled =
208 profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled);
207 // TypedUrl sync is enabled by default. Register unless explicitly disabled, 209 // TypedUrl sync is enabled by default. Register unless explicitly disabled,
208 // or if saving history is disabled. 210 // or if saving history is disabled.
209 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && 211 if (!disabled_types.Has(syncer::TYPED_URLS) && !history_disabled) {
210 !disabled_types.Has(syncer::TYPED_URLS)) {
211 pss->RegisterDataTypeController( 212 pss->RegisterDataTypeController(
212 new TypedUrlDataTypeController(this, profile_, pss)); 213 new TypedUrlDataTypeController(this, profile_, pss));
213 } 214 }
214 215
215 // Delete directive sync is enabled by default. Register unless full history 216 // Delete directive sync is enabled by default. Register unless full history
216 // sync is disabled. 217 // sync is disabled.
217 if (!disabled_types.Has(syncer::HISTORY_DELETE_DIRECTIVES)) { 218 if (!disabled_types.Has(syncer::HISTORY_DELETE_DIRECTIVES)) {
218 pss->RegisterDataTypeController( 219 pss->RegisterDataTypeController(
219 new UIDataTypeController( 220 new UIDataTypeController(
220 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 221 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
221 base::Bind(&ChromeReportUnrecoverableError), 222 base::Bind(&ChromeReportUnrecoverableError),
222 syncer::HISTORY_DELETE_DIRECTIVES, 223 syncer::HISTORY_DELETE_DIRECTIVES,
223 this)); 224 this));
224 } 225 }
225 226
226 // Session sync is enabled by default. Register unless explicitly disabled. 227 // Session sync is enabled by default. Register unless explicitly disabled.
227 if (!disabled_types.Has(syncer::PROXY_TABS)) { 228 // This is also disabled if the browser history is disabled, because the
229 // tab sync data is added to the web history on the server.
230 if (!disabled_types.Has(syncer::PROXY_TABS) && !history_disabled) {
228 pss->RegisterDataTypeController(new ProxyDataTypeController( 231 pss->RegisterDataTypeController(new ProxyDataTypeController(
229 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 232 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
230 syncer::PROXY_TABS)); 233 syncer::PROXY_TABS));
231 pss->RegisterDataTypeController( 234 pss->RegisterDataTypeController(
232 new SessionDataTypeController(this, 235 new SessionDataTypeController(this,
233 profile_, 236 profile_,
234 pss->GetSyncedWindowDelegatesGetter(), 237 pss->GetSyncedWindowDelegatesGetter(),
235 pss->GetLocalDeviceInfoProvider())); 238 pss->GetLocalDeviceInfoProvider()));
236 } 239 }
237 240
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 new TypedUrlModelAssociator(profile_sync_service, 677 new TypedUrlModelAssociator(profile_sync_service,
675 history_backend, 678 history_backend,
676 error_handler); 679 error_handler);
677 TypedUrlChangeProcessor* change_processor = 680 TypedUrlChangeProcessor* change_processor =
678 new TypedUrlChangeProcessor(profile_, 681 new TypedUrlChangeProcessor(profile_,
679 model_associator, 682 model_associator,
680 history_backend, 683 history_backend,
681 error_handler); 684 error_handler);
682 return SyncComponents(model_associator, change_processor); 685 return SyncComponents(model_associator, change_processor);
683 } 686 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698