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

Unified Diff: chrome/browser/sync/glue/preference_change_processor.cc

Issue 3051001: Adjust preference sync code to only sync user modifiable preferences. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: separate out the download_manager_unittest.cc fixes Created 10 years, 5 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
« no previous file with comments | « chrome/browser/pref_value_store.cc ('k') | chrome/browser/sync/glue/preference_model_associator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/preference_change_processor.cc
diff --git a/chrome/browser/sync/glue/preference_change_processor.cc b/chrome/browser/sync/glue/preference_change_processor.cc
index 0958bec326df7cab7390f29ddcb7dd9231d7bf41..2b8a6fe2145f61333024fc9e19761b2349ac92b4 100644
--- a/chrome/browser/sync/glue/preference_change_processor.cc
+++ b/chrome/browser/sync/glue/preference_change_processor.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -48,12 +48,13 @@ void PreferenceChangeProcessor::Observe(NotificationType type,
pref_service_->FindPreference((*name).c_str());
DCHECK(preference);
- // TODO(mnissler): Detect preference->IsManaged() state changes here and call
- // into PreferenceModelAssociator to associate/disassociate sync nodes when
- // the state changes.
+ // TODO(mnissler): Detect preference->IsUserControlled() state changes here
+ // and call into PreferenceModelAssociator to associate/disassociate sync
+ // nodes when the state changes.
- // Do not pollute sync data with values coming from policy.
- if (preference->IsManaged())
+ // Do not pollute sync data with values coming from policy, extensions or the
+ // commandline.
+ if (!preference->IsUserModifiable())
return;
sync_api::WriteTransaction trans(share_handle());
@@ -141,11 +142,11 @@ void PreferenceChangeProcessor::ApplyChangesFromSyncModel(
if (model_associator_->synced_preferences().count(pref_name) == 0)
continue;
- // Don't try to overwrite preferences controlled by policy.
+ // Don't try to overwrite preferences not controllable by the user.
const PrefService::Preference* pref =
pref_service_->FindPreference(pref_name);
DCHECK(pref);
- if (pref->IsManaged())
+ if (!pref->IsUserModifiable())
continue;
if (sync_api::SyncManager::ChangeRecord::ACTION_DELETE ==
« no previous file with comments | « chrome/browser/pref_value_store.cc ('k') | chrome/browser/sync/glue/preference_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698