Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / extensions / chromeos / kiosk_app_list.js
index 1af01cf..3652f95 100644 (file)
@@ -17,14 +17,29 @@ 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();
       item.data = app;
+      item.autoLaunchEnabled = this.autoLaunchEnabled_;
       return item;
     },
 
     /**
+     * Sets auto launch enabled flag.
+     * @param {boolean} enabled True if auto launch should be enabled.
+     */
+    setAutoLaunchEnabled: function(enabled) {
+      this.autoLaunchEnabled_ = enabled;
+    },
+
+    /**
      * Loads the given list of apps.
      * @param {!Array.<!Object>} apps An array of app info objects.
      */
@@ -67,15 +82,22 @@ cr.define('extensions', function() {
      * @private
      */
     data_: null,
+
     get data() {
       assert(this.data_);
       return this.data_;
     },
+
     set data(data) {
       this.data_ = data;
       this.redraw();
     },
 
+    set autoLaunchEnabled(enabled) {
+      this.querySelector('.enable-auto-launch-button').hidden = !enabled;
+      this.querySelector('.disable-auto-launch-button').hidden = !enabled;
+    },
+
     /**
      * Getter for the icon element.
      * @type {Element}
@@ -111,9 +133,9 @@ cr.define('extensions', function() {
       }.bind(this);
 
       this.querySelector('.enable-auto-launch-button').onclick =
-          sendMessageWithId('enableKioskAutoLaunch');
+        sendMessageWithId('enableKioskAutoLaunch');
       this.querySelector('.disable-auto-launch-button').onclick =
-          sendMessageWithId('disableKioskAutoLaunch');
+        sendMessageWithId('disableKioskAutoLaunch');
       this.querySelector('.row-delete-button').onclick =
           sendMessageWithId('removeKioskApp');
     },