| Index: chrome/browser/resources/options/browser_options.js
|
| diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
|
| index c3afd4b380837765143392aa624e2a199f9de839..e2a53d52f444ac2359d3d02208e661a6d324b7ae 100644
|
| --- a/chrome/browser/resources/options/browser_options.js
|
| +++ b/chrome/browser/resources/options/browser_options.js
|
| @@ -1508,16 +1508,15 @@ cr.define('options', function() {
|
| * @param {boolean} managed
|
| */
|
| setWallpaperManaged_: function(managed) {
|
| - var button = $('set-wallpaper');
|
| - button.disabled = !!managed;
|
| + if (managed)
|
| + $('set-wallpaper').disabled = true;
|
| + else
|
| + this.enableElementIfPossible_($('set-wallpaper'));
|
|
|
| // Create a synthetic pref change event decorated as
|
| // CoreOptionsHandler::CreateValueForPref() does.
|
| var event = new Event('wallpaper');
|
| - if (managed)
|
| - event.value = { controlledBy: 'policy' };
|
| - else
|
| - event.value = {};
|
| + event.value = managed ? { controlledBy: 'policy' } : {};
|
| $('wallpaper-indicator').handlePrefChange(event);
|
| },
|
|
|
| @@ -1968,6 +1967,18 @@ cr.define('options', function() {
|
| handleSetTime_: function() {
|
| chrome.send('showSetTime');
|
| },
|
| +
|
| + /**
|
| + * Enables the given element if possible; on Chrome OS, it won't enable
|
| + * an element that must stay disabled for the session type.
|
| + * @param {!Element} element Element to enable.
|
| + */
|
| + enableElementIfPossible_: function(element) {
|
| + if (cr.isChromeOS)
|
| + UIAccountTweaks.enableElementIfPossible(element);
|
| + else
|
| + element.disabled = false;
|
| + },
|
| };
|
|
|
| //Forward public APIs to private implementations.
|
|
|