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 cr.define('extensions', function() { | 5 cr.define('extensions', function() { |
6 /** | 6 /** |
7 * Encapsulated handling of ChromeOS kiosk apps options page. | 7 * Encapsulated handling of ChromeOS kiosk apps options page. |
8 * @constructor | 8 * @constructor |
9 */ | 9 */ |
10 function KioskAppsOverlay() { | 10 function KioskAppsOverlay() { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 * @private | 93 * @private |
94 */ | 94 */ |
95 handleDismiss_: function() { | 95 handleDismiss_: function() { |
96 this.handleAddButtonClick_(); | 96 this.handleAddButtonClick_(); |
97 extensions.ExtensionSettings.showOverlay(null); | 97 extensions.ExtensionSettings.showOverlay(null); |
98 } | 98 } |
99 }; | 99 }; |
100 | 100 |
101 /** | 101 /** |
102 * Sets apps to be displayed in kiosk-app-list. | 102 * Sets apps to be displayed in kiosk-app-list. |
103 * @param {!Object.<{apps: !Array.<AppDict>, disableBailout: boolean, | 103 * @param {!Object.<{apps: !Array.<Object>, disableBailout: boolean}>} |
104 * hasAutoLaunchApp: boolean}>} settings An object containing an array of | 104 * settings An object containing an array of app info objects and |
105 * app info objects and disable bailout shortcut flag. | 105 * disable bailout shortcut flag. |
106 */ | 106 */ |
107 KioskAppsOverlay.setSettings = function(settings) { | 107 KioskAppsOverlay.setSettings = function(settings) { |
108 $('kiosk-app-list').setApps(settings.apps); | 108 $('kiosk-app-list').setApps(settings.apps); |
109 $('kiosk-disable-bailout-shortcut').checked = settings.disableBailout; | 109 $('kiosk-disable-bailout-shortcut').checked = settings.disableBailout; |
110 $('kiosk-disable-bailout-shortcut').disabled = !settings.hasAutoLaunchApp; | 110 $('kiosk-disable-bailout-shortcut').disabled = !settings.hasAutoLaunchApp; |
111 }; | 111 }; |
112 | 112 |
113 /** | 113 /** |
114 * Update an app in kiosk-app-list. | 114 * Update an app in kiosk-app-list. |
115 * @param {!Object} app App info to be updated. | 115 * @param {!Object} app App info to be updated. |
116 */ | 116 */ |
117 KioskAppsOverlay.updateApp = function(app) { | 117 KioskAppsOverlay.updateApp = function(app) { |
118 $('kiosk-app-list').updateApp(app); | 118 $('kiosk-app-list').updateApp(app); |
119 }; | 119 }; |
120 | 120 |
121 /** | 121 /** |
122 * Shows error for given app name/id. | 122 * Shows error for given app name/id. |
123 * @param {!string} appName App name/id to show in error banner. | 123 * @param {!string} appName App name/id to show in error banner. |
124 */ | 124 */ |
125 KioskAppsOverlay.showError = function(appName) { | 125 KioskAppsOverlay.showError = function(appName) { |
126 KioskAppsOverlay.getInstance().showError(appName); | 126 KioskAppsOverlay.getInstance().showError(appName); |
127 }; | 127 }; |
128 | 128 |
129 /** | 129 /** |
130 * Enables consumer kiosk. | 130 * Enables consumer kiosk. |
131 * @param {!{kioskEnabled: boolean, autoLaunchEnabled: boolean}} params | 131 * @param {!boolean} enable True if consumer kiosk feature is enabled. |
132 */ | 132 */ |
133 KioskAppsOverlay.enableKiosk = function(params) { | 133 KioskAppsOverlay.enableKiosk = function(params) { |
134 $('add-kiosk-app').hidden = !params.kioskEnabled; | 134 $('add-kiosk-app').hidden = !params.kioskEnabled; |
135 $('kiosk-disable-bailout-shortcut').parentNode.hidden = | 135 $('kiosk-disable-bailout-shortcut').parentNode.hidden = |
136 !params.autoLaunchEnabled; | 136 !params.autoLaunchEnabled; |
137 $('kiosk-app-list').setAutoLaunchEnabled(params.autoLaunchEnabled); | 137 $('kiosk-app-list').setAutoLaunchEnabled(params.autoLaunchEnabled); |
138 }; | 138 }; |
139 | 139 |
140 // Export | 140 // Export |
141 return { | 141 return { |
142 KioskAppsOverlay: KioskAppsOverlay | 142 KioskAppsOverlay: KioskAppsOverlay |
143 }; | 143 }; |
144 }); | 144 }); |
145 | 145 |
146 <include src="kiosk_app_list.js"> | 146 <include src="kiosk_app_list.js"> |
147 <include src="kiosk_app_disable_bailout_confirm.js"> | 147 <include src="kiosk_app_disable_bailout_confirm.js"> |
OLD | NEW |