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 * @fileoverview Kiosk apps menu implementation. | 6 * @fileoverview Kiosk apps menu implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('login', function() { | 9 cr.define('login', function() { |
10 'use strict'; | 10 'use strict'; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 menuItem.appId = app.id; | 137 menuItem.appId = app.id; |
138 menuItem.addEventListener('activate', function(e) { | 138 menuItem.addEventListener('activate', function(e) { |
139 var diagnosticMode = e.originalEvent && e.originalEvent.ctrlKey; | 139 var diagnosticMode = e.originalEvent && e.originalEvent.ctrlKey; |
140 this.launchApp_(app, diagnosticMode); | 140 this.launchApp_(app, diagnosticMode); |
141 }.bind(this)); | 141 }.bind(this)); |
142 } | 142 } |
143 }; | 143 }; |
144 | 144 |
145 /** | 145 /** |
146 * Sets apps to be displayed in the apps menu. | 146 * Sets apps to be displayed in the apps menu. |
147 * @param {!Array.<!Object>} apps An array of app info objects. | 147 * @param {!Array<!Object>} apps An array of app info objects. |
148 */ | 148 */ |
149 AppsMenuButton.setApps = function(apps) { | 149 AppsMenuButton.setApps = function(apps) { |
150 $('show-apps-button').data = apps; | 150 $('show-apps-button').data = apps; |
151 $('login-header-bar').hasApps = | 151 $('login-header-bar').hasApps = |
152 apps.length > 0 || loadTimeData.getBoolean('kioskAppHasLaunchError'); | 152 apps.length > 0 || loadTimeData.getBoolean('kioskAppHasLaunchError'); |
153 chrome.send('kioskAppsLoaded'); | 153 chrome.send('kioskAppsLoaded'); |
154 }; | 154 }; |
155 | 155 |
156 /** | 156 /** |
157 * Shows the given error message. | 157 * Shows the given error message. |
(...skipping 17 matching lines...) Expand all Loading... |
175 * mode. Default is false. | 175 * mode. Default is false. |
176 */ | 176 */ |
177 AppsMenuButton.runAppForTesting = function(id, opt_diagnostic_mode) { | 177 AppsMenuButton.runAppForTesting = function(id, opt_diagnostic_mode) { |
178 $('show-apps-button').findAndRunAppForTesting(id, opt_diagnostic_mode); | 178 $('show-apps-button').findAndRunAppForTesting(id, opt_diagnostic_mode); |
179 }; | 179 }; |
180 | 180 |
181 return { | 181 return { |
182 AppsMenuButton: AppsMenuButton | 182 AppsMenuButton: AppsMenuButton |
183 }; | 183 }; |
184 }); | 184 }); |
OLD | NEW |