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

Unified Diff: chrome/browser/resources/options/pref_ui.js

Issue 7342009: Show a different banner in chrome://settings for extension-controlled settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 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
Index: chrome/browser/resources/options/pref_ui.js
diff --git a/chrome/browser/resources/options/pref_ui.js b/chrome/browser/resources/options/pref_ui.js
index 6e9c613147e2324bad41e8831c893070f37fb0f1..d58172cae052bbbeb1a31fdc6d8a31240add34a7 100644
--- a/chrome/browser/resources/options/pref_ui.js
+++ b/chrome/browser/resources/options/pref_ui.js
@@ -13,12 +13,12 @@ cr.define('options', function() {
* @param {!Event} event The pref change event.
*/
function updateElementState_(el, event) {
- el.managed = false;
+ el.controlledBy = null;
if (!event.value)
return;
- el.managed = event.value['managed'];
+ el.controlledBy = event.value['controlledBy'];
// Disable UI elements if the backend says so.
// |reenable| is a flag that tells us if the element is disabled because the
@@ -30,6 +30,8 @@ cr.define('options', function() {
el.disabled = event.value['disabled'];
el.notUserModifiable = event.value['disabled'];
+
+ OptionsPage.updateManagedBannerVisibility();
}
/////////////////////////////////////////////////////////////////////////////
@@ -102,6 +104,13 @@ cr.define('options', function() {
cr.defineProperty(PrefCheckbox, 'pref', cr.PropertyKind.ATTR);
/**
+ * Whether the preference is controlled by something else than the user's
+ * settings (either 'policy' or 'extension').
+ * @type {string}
+ */
+ cr.defineProperty(PrefCheckbox, 'controlledBy', cr.PropertyKind.ATTR);
+
+ /**
* The user metric string.
* @type {string}
*/
@@ -161,6 +170,13 @@ cr.define('options', function() {
cr.defineProperty(PrefRadio, 'pref', cr.PropertyKind.ATTR);
/**
+ * Whether the preference is controlled by something else than the user's
+ * settings (either 'policy' or 'extension').
+ * @type {string}
+ */
+ cr.defineProperty(PrefRadio, 'controlledBy', cr.PropertyKind.ATTR);
+
+ /**
* The user metric string.
* @type {string}
*/
@@ -207,6 +223,13 @@ cr.define('options', function() {
cr.defineProperty(PrefNumeric, 'pref', cr.PropertyKind.ATTR);
/**
+ * Whether the preference is controlled by something else than the user's
+ * settings (either 'policy' or 'extension').
+ * @type {string}
+ */
+ cr.defineProperty(PrefNumeric, 'controlledBy', cr.PropertyKind.ATTR);
+
+ /**
* The user metric string.
* @type {string}
*/
@@ -353,6 +376,13 @@ cr.define('options', function() {
cr.defineProperty(PrefRange, 'pref', cr.PropertyKind.ATTR);
/**
+ * Whether the preference is controlled by something else than the user's
+ * settings (either 'policy' or 'extension').
+ * @type {string}
+ */
+ cr.defineProperty(PrefRange, 'controlledBy', cr.PropertyKind.ATTR);
+
+ /**
* The user metric string.
* @type {string}
*/
@@ -443,6 +473,13 @@ cr.define('options', function() {
cr.defineProperty(PrefSelect, 'pref', cr.PropertyKind.ATTR);
/**
+ * Whether the preference is controlled by something else than the user's
+ * settings (either 'policy' or 'extension').
+ * @type {string}
+ */
+ cr.defineProperty(PrefSelect, 'controlledBy', cr.PropertyKind.ATTR);
+
+ /**
* The user metric string.
* @type {string}
*/
@@ -510,6 +547,13 @@ cr.define('options', function() {
cr.defineProperty(PrefTextField, 'pref', cr.PropertyKind.ATTR);
/**
+ * Whether the preference is controlled by something else than the user's
+ * settings (either 'policy' or 'extension').
+ * @type {string}
+ */
+ cr.defineProperty(PrefTextField, 'controlledBy', cr.PropertyKind.ATTR);
+
+ /**
* The user metric string.
* @type {string}
*/
« no previous file with comments | « chrome/browser/resources/options/personal_options.js ('k') | chrome/browser/ui/webui/options/advanced_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698