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

Unified Diff: chrome/browser/resources/settings/prefs/prefs.js

Issue 1310373008: Add cr_policy_indicator for settings controls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md_settings_compiled_resources_3
Patch Set: Revert unrelated changes Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/prefs/prefs.js
diff --git a/chrome/browser/resources/settings/prefs/prefs.js b/chrome/browser/resources/settings/prefs/prefs.js
index 98c82f78b5c4543a20fc1dd601e5bfabe98b010c..5e89860ac703d766ede1a8af6de82236a6bff57d 100644
--- a/chrome/browser/resources/settings/prefs/prefs.js
+++ b/chrome/browser/resources/settings/prefs/prefs.js
@@ -236,17 +236,12 @@ function ListPrefWrapper(prefObj) {
* @private
*/
setPref_: function(newPrefObj) {
- // Check if the pref exists already in the Polymer |prefs| object.
- if (this.get(newPrefObj.key, this.prefs)) {
- // Update just the value, notifying listeners of the change.
- this.set('prefs.' + newPrefObj.key + '.value', newPrefObj.value);
- } else {
- // Add the pref to |prefs|. cr.exportPath doesn't use Polymer.Base.set,
- // which is OK because the nested property update events aren't useful.
- cr.exportPath(newPrefObj.key, newPrefObj, this.prefs);
- // Notify listeners of the change at the preference key.
- this.notifyPath('prefs.' + newPrefObj.key, newPrefObj);
- }
+ // Add the pref object to |prefs| if necessary and set it. Note: we need
+ // to always set the entire object, not just the value, in case any policy
+ // or other attributes change.
+ cr.exportPath(newPrefObj.key, newPrefObj, this.prefs);
+ // Notify listeners of the change at the preference key.
+ this.notifyPath('prefs.' + newPrefObj.key, newPrefObj);
},
/**

Powered by Google App Engine
This is Rietveld 408576698