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

Side by Side Diff: chrome/browser/resources/options/controlled_setting.js

Issue 152143009: Clarify settings UI in multi-profiles mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: string fixes, rebase Created 6 years, 10 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 cr.define('options', function() { 5 cr.define('options', function() {
6 var Preferences = options.Preferences; 6 var Preferences = options.Preferences;
7 7
8 /** 8 /**
9 * A controlled setting indicator that can be placed on a setting as an 9 * A controlled setting indicator that can be placed on a setting as an
10 * indicator that the value is controlled by some external entity such as 10 * indicator that the value is controlled by some external entity such as
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 var self = this; 98 var self = this;
99 99
100 // Construct the bubble text. 100 // Construct the bubble text.
101 if (this.hasAttribute('plural')) { 101 if (this.hasAttribute('plural')) {
102 var defaultStrings = { 102 var defaultStrings = {
103 'policy': loadTimeData.getString('controlledSettingsPolicy'), 103 'policy': loadTimeData.getString('controlledSettingsPolicy'),
104 'extension': loadTimeData.getString('controlledSettingsExtension'), 104 'extension': loadTimeData.getString('controlledSettingsExtension'),
105 'extensionWithName': loadTimeData.getString( 105 'extensionWithName': loadTimeData.getString(
106 'controlledSettingsExtensionWithName'), 106 'controlledSettingsExtensionWithName'),
107 }; 107 };
108 if (cr.isChromeOS) {
109 defaultStrings['shared'] =
110 loadTimeData.getString('controlledSettingsShared');
111 }
108 } else { 112 } else {
109 var defaultStrings = { 113 var defaultStrings = {
110 'policy': loadTimeData.getString('controlledSettingPolicy'), 114 'policy': loadTimeData.getString('controlledSettingPolicy'),
111 'extension': loadTimeData.getString('controlledSettingExtension'), 115 'extension': loadTimeData.getString('controlledSettingExtension'),
112 'extensionWithName': loadTimeData.getString( 116 'extensionWithName': loadTimeData.getString(
113 'controlledSettingExtensionWithName'), 117 'controlledSettingExtensionWithName'),
114 'recommended': 118 'recommended':
115 loadTimeData.getString('controlledSettingRecommended'), 119 loadTimeData.getString('controlledSettingRecommended'),
116 'hasRecommendation': 120 'hasRecommendation':
117 loadTimeData.getString('controlledSettingHasRecommendation'), 121 loadTimeData.getString('controlledSettingHasRecommendation'),
118 }; 122 };
119 if (cr.isChromeOS) { 123 if (cr.isChromeOS) {
120 defaultStrings.owner = 124 defaultStrings['owner'] =
121 loadTimeData.getString('controlledSettingOwner'); 125 loadTimeData.getString('controlledSettingOwner');
122 } 126 }
123 } 127 }
124 128
125 // No controller, no bubble. 129 // No controller, no bubble.
126 if (!this.controlledBy || !(this.controlledBy in defaultStrings)) 130 if (!this.controlledBy || !(this.controlledBy in defaultStrings))
127 return; 131 return;
128 132
129 var text = defaultStrings[this.controlledBy]; 133 var text = defaultStrings[this.controlledBy];
130 if (this.controlledBy == 'extension' && this.extensionName) 134 if (this.controlledBy == 'extension' && this.extensionName)
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 cr.PropertyKind.ATTR); 218 cr.PropertyKind.ATTR);
215 219
216 /** 220 /**
217 * The status of the associated preference: 221 * The status of the associated preference:
218 * - 'policy': A specific value is enfoced by policy. 222 * - 'policy': A specific value is enfoced by policy.
219 * - 'extension': A specific value is enforced by an extension. 223 * - 'extension': A specific value is enforced by an extension.
220 * - 'recommended': A value is recommended by policy. The user could 224 * - 'recommended': A value is recommended by policy. The user could
221 * override this recommendation but has not done so. 225 * override this recommendation but has not done so.
222 * - 'hasRecommendation': A value is recommended by policy. The user has 226 * - 'hasRecommendation': A value is recommended by policy. The user has
223 * overridden this recommendation. 227 * overridden this recommendation.
228 * - 'owner': A value is controlled by the owner of the device
229 * (Chrome OS only).
230 * - 'shared': A value belongs to the primary user but can be
231 * modified (Chrome OS only).
224 * - unset: The value is controlled by the user alone. 232 * - unset: The value is controlled by the user alone.
225 * @type {string} 233 * @type {string}
226 */ 234 */
227 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', 235 cr.defineProperty(ControlledSettingIndicator, 'controlledBy',
228 cr.PropertyKind.ATTR); 236 cr.PropertyKind.ATTR);
229 237
230 // Export. 238 // Export.
231 return { 239 return {
232 ControlledSettingIndicator: ControlledSettingIndicator 240 ControlledSettingIndicator: ControlledSettingIndicator
233 }; 241 };
234 }); 242 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698