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

Side by Side Diff: chrome/browser/resources/extensions/chromeos/kiosk_apps.js

Issue 475633006: Typecheck JS files for chrome://extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@D_asserts_codingconvention
Patch Set: looked twice Created 6 years, 4 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 unified diff | Download patch
OLDNEW
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
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.<Object>, disableBailout: boolean}>} 103 * @param {!Object.<{apps: !Array.<BackendAppDataObject>,
104 * settings An object containing an array of app info objects and 104 * disableBailout: boolean, hasAutoLaunchApp: boolean}>} settings
105 * An object containing an array of app info objects and
105 * disable bailout shortcut flag. 106 * disable bailout shortcut flag.
106 */ 107 */
107 KioskAppsOverlay.setSettings = function(settings) { 108 KioskAppsOverlay.setSettings = function(settings) {
108 $('kiosk-app-list').setApps(settings.apps); 109 $('kiosk-app-list').setApps(settings.apps);
109 $('kiosk-disable-bailout-shortcut').checked = settings.disableBailout; 110 $('kiosk-disable-bailout-shortcut').checked = settings.disableBailout;
110 $('kiosk-disable-bailout-shortcut').disabled = !settings.hasAutoLaunchApp; 111 $('kiosk-disable-bailout-shortcut').disabled = !settings.hasAutoLaunchApp;
111 }; 112 };
112 113
113 /** 114 /**
114 * Update an app in kiosk-app-list. 115 * Update an app in kiosk-app-list.
115 * @param {!Object} app App info to be updated. 116 * @param {!Object} app App info to be updated.
116 */ 117 */
117 KioskAppsOverlay.updateApp = function(app) { 118 KioskAppsOverlay.updateApp = function(app) {
118 $('kiosk-app-list').updateApp(app); 119 $('kiosk-app-list').updateApp(app);
119 }; 120 };
120 121
121 /** 122 /**
122 * Shows error for given app name/id. 123 * Shows error for given app name/id.
123 * @param {!string} appName App name/id to show in error banner. 124 * @param {!string} appName App name/id to show in error banner.
124 */ 125 */
125 KioskAppsOverlay.showError = function(appName) { 126 KioskAppsOverlay.showError = function(appName) {
126 KioskAppsOverlay.getInstance().showError(appName); 127 KioskAppsOverlay.getInstance().showError(appName);
127 }; 128 };
128 129
129 /** 130 /**
130 * Enables consumer kiosk. 131 * Enables consumer kiosk.
131 * @param {!boolean} enable True if consumer kiosk feature is enabled. 132 * @param {!{kioskEnabled: boolean, autoLaunchEnabled: boolean}} params
132 */ 133 */
133 KioskAppsOverlay.enableKiosk = function(params) { 134 KioskAppsOverlay.enableKiosk = function(params) {
134 $('add-kiosk-app').hidden = !params.kioskEnabled; 135 $('add-kiosk-app').hidden = !params.kioskEnabled;
135 $('kiosk-disable-bailout-shortcut').parentNode.hidden = 136 $('kiosk-disable-bailout-shortcut').parentNode.hidden =
136 !params.autoLaunchEnabled; 137 !params.autoLaunchEnabled;
137 $('kiosk-app-list').setAutoLaunchEnabled(params.autoLaunchEnabled); 138 $('kiosk-app-list').setAutoLaunchEnabled(params.autoLaunchEnabled);
138 }; 139 };
139 140
140 // Export 141 // Export
141 return { 142 return {
142 KioskAppsOverlay: KioskAppsOverlay 143 KioskAppsOverlay: KioskAppsOverlay
143 }; 144 };
144 }); 145 });
145 146
146 <include src="kiosk_app_list.js"> 147 <include src="kiosk_app_list.js">
147 <include src="kiosk_app_disable_bailout_confirm.js"> 148 <include src="kiosk_app_disable_bailout_confirm.js">
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698