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

Unified Diff: chrome/browser/sync/glue/typed_url_data_type_controller.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/glue/typed_url_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc
index caaa099c6599c7d1079b3dc50378a9d91c143ac9..f084f7f1444f279358319df15f202556fce00ffb 100644
--- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc
+++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc
@@ -94,20 +94,16 @@ syncer::ModelSafeGroup TypedUrlDataTypeController::model_safe_group()
void TypedUrlDataTypeController::LoadModels(
const ModelLoadCallback& model_load_callback) {
- if (profile()->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) {
- model_load_callback.Run(
- type(),
- syncer::SyncError(FROM_HERE,
- syncer::SyncError::DATATYPE_ERROR,
- "History sync disabled by policy.",
- type()));
- return;
- }
-
set_state(MODEL_LOADED);
model_load_callback.Run(type(), syncer::SyncError());
}
+bool TypedUrlDataTypeController::ReadyForStart() const {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ return !profile()->GetPrefs()->GetBoolean(
+ prefs::kSavingBrowserHistoryDisabled);
+}
+
void TypedUrlDataTypeController::SetBackend(history::HistoryBackend* backend) {
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
backend_ = backend;
@@ -126,7 +122,7 @@ void TypedUrlDataTypeController::OnSavingBrowserHistoryDisabledChanged() {
syncer::SyncError::DATATYPE_POLICY_ERROR,
"History saving is now disabled by policy.",
syncer::TYPED_URLS);
- OnSingleDataTypeUnrecoverableError(error);
+ DisableImpl(error);
}
}
}
« no previous file with comments | « chrome/browser/sync/glue/typed_url_data_type_controller.h ('k') | chrome/browser/sync/profile_sync_components_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698