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

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: a bit clearer? Created 6 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/options/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index 1bc711f8e33eaccc7c1fde4d77f5493a1b866c1f..fa610e35421ca8d79fbb4c7867416732bb485f1b 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -1492,8 +1492,10 @@ 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.
@@ -1939,6 +1941,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.

Powered by Google App Engine
This is Rietveld 408576698