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

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

Issue 599723002: Disable wallpaper button in Guest mode settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | ui/webui/resources/js/chromeos/ui_account_tweaks.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | ui/webui/resources/js/chromeos/ui_account_tweaks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698