Index: chrome/browser/resources/extensions/chromeos/kiosk_app_list.js |
diff --git a/chrome/browser/resources/extensions/chromeos/kiosk_app_list.js b/chrome/browser/resources/extensions/chromeos/kiosk_app_list.js |
index 1af01cf21eeffa7eb3e8b7da786e9e129c5c7e67..8950893d41b6bd4b2a0a83029ed84520e11347bd 100644 |
--- a/chrome/browser/resources/extensions/chromeos/kiosk_app_list.js |
+++ b/chrome/browser/resources/extensions/chromeos/kiosk_app_list.js |
@@ -17,6 +17,12 @@ cr.define('extensions', function() { |
KioskAppList.prototype = { |
__proto__: List.prototype, |
+ /** |
+ * True if auto launch feature can be configured. |
+ * @type {?boolean} |
+ */ |
+ autoLaunchEnabled_: false, |
+ |
/** @override */ |
createItem: function(app) { |
var item = new KioskAppListItem(); |
@@ -28,6 +34,14 @@ cr.define('extensions', function() { |
* Loads the given list of apps. |
* @param {!Array.<!Object>} apps An array of app info objects. |
*/ |
+ setAutoLaunchEnabled: function(enabled) { |
+ this.autoLaunchEnabled_ = enabled; |
+ }, |
+ |
+ /** |
+ * Loads the given list of apps. |
+ * @param {!Array.<!Object>} apps An array of app info objects. |
+ */ |
setApps: function(apps) { |
this.dataModel = new ArrayDataModel(apps); |
}, |
@@ -40,6 +54,7 @@ cr.define('extensions', function() { |
for (var i = 0; i < this.items.length; ++i) { |
if (this.items[i].data.id == app.id) { |
this.items[i].data = app; |
+ this.items[i].data.autoLaunchEnabled_ = this.autoLaunchEnabled_; |
break; |
} |
} |
@@ -110,10 +125,16 @@ cr.define('extensions', function() { |
}.bind(this); |
}.bind(this); |
- this.querySelector('.enable-auto-launch-button').onclick = |
- sendMessageWithId('enableKioskAutoLaunch'); |
- this.querySelector('.disable-auto-launch-button').onclick = |
- sendMessageWithId('disableKioskAutoLaunch'); |
+ if (this.autoLaunchEnabled_) { |
+ this.querySelector('.enable-auto-launch-button').onclick = |
+ sendMessageWithId('enableKioskAutoLaunch'); |
+ this.querySelector('.disable-auto-launch-button').onclick = |
+ sendMessageWithId('disableKioskAutoLaunch'); |
+ } else { |
+ this.querySelector('.enable-auto-launch-button').hidden = true; |
+ this.querySelector('.disable-auto-launch-button').hidden = true; |
+ } |
+ |
this.querySelector('.row-delete-button').onclick = |
sendMessageWithId('removeKioskApp'); |
}, |