| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * The type of the app data object. The definition is based on | 6 * The type of the app data object. The definition is based on |
| 7 * chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc: | 7 * chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc: |
| 8 * PopulateAppDict() | 8 * PopulateAppDict() |
| 9 * @typedef {{id: string, | 9 * @typedef {{id: string, |
| 10 * name: string, | 10 * name: string, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 decorate: function() { | 138 decorate: function() { |
| 139 ListItem.prototype.decorate.call(this); | 139 ListItem.prototype.decorate.call(this); |
| 140 | 140 |
| 141 var sendMessageWithId = function(msg) { | 141 var sendMessageWithId = function(msg) { |
| 142 return function() { | 142 return function() { |
| 143 chrome.send(msg, [this.data.id]); | 143 chrome.send(msg, [this.data.id]); |
| 144 }.bind(this); | 144 }.bind(this); |
| 145 }.bind(this); | 145 }.bind(this); |
| 146 | 146 |
| 147 this.querySelector('.enable-auto-launch-button').onclick = | 147 this.querySelector('.enable-auto-launch-button').onclick = |
| 148 sendMessageWithId('enableKioskAutoLaunch'); | 148 sendMessageWithId('enableKioskAutoLaunch'); |
| 149 this.querySelector('.disable-auto-launch-button').onclick = | 149 this.querySelector('.disable-auto-launch-button').onclick = |
| 150 sendMessageWithId('disableKioskAutoLaunch'); | 150 sendMessageWithId('disableKioskAutoLaunch'); |
| 151 this.querySelector('.row-delete-button').onclick = | 151 this.querySelector('.row-delete-button').onclick = |
| 152 sendMessageWithId('removeKioskApp'); | 152 sendMessageWithId('removeKioskApp'); |
| 153 }, | 153 }, |
| 154 | 154 |
| 155 /** | 155 /** |
| 156 * Updates UI from app info data. | 156 * Updates UI from app info data. |
| 157 */ | 157 */ |
| 158 redraw: function() { | 158 redraw: function() { |
| 159 this.icon.classList.toggle('spinner', this.data.isLoading); | 159 this.icon.classList.toggle('spinner', this.data.isLoading); |
| 160 this.icon.style.backgroundImage = 'url(' + this.data.iconURL + ')'; | 160 this.icon.style.backgroundImage = 'url(' + this.data.iconURL + ')'; |
| 161 | 161 |
| 162 this.name.textContent = this.data.name || this.data.id; | 162 this.name.textContent = this.data.name || this.data.id; |
| 163 this.status.textContent = this.data.autoLaunch ? | 163 this.status.textContent = |
| 164 loadTimeData.getString('autoLaunch') : ''; | 164 this.data.autoLaunch ? loadTimeData.getString('autoLaunch') : ''; |
| 165 | 165 |
| 166 this.autoLaunch = this.data.autoLaunch; | 166 this.autoLaunch = this.data.autoLaunch; |
| 167 } | 167 } |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 /** | 170 /** |
| 171 * True if the app represented by this item will auto launch. | 171 * True if the app represented by this item will auto launch. |
| 172 */ | 172 */ |
| 173 cr.defineProperty(KioskAppListItem, 'autoLaunch', cr.PropertyKind.BOOL_ATTR); | 173 cr.defineProperty(KioskAppListItem, 'autoLaunch', cr.PropertyKind.BOOL_ATTR); |
| 174 | 174 |
| 175 // Export | 175 // Export |
| 176 return { | 176 return {KioskAppList: KioskAppList}; |
| 177 KioskAppList: KioskAppList | |
| 178 }; | |
| 179 }); | 177 }); |
| OLD | NEW |