OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview App install/launch splash screen implementation. |
| 7 */ |
| 8 |
| 9 login.createScreen('AppLaunchSplashScreen', 'app-launch-splash', function() { |
| 10 return { |
| 11 EXTERNAL_API: [ |
| 12 'toggleNetworkConfig', |
| 13 'updateApp', |
| 14 'updateMessage', |
| 15 ], |
| 16 |
| 17 /** |
| 18 * Event handler that is invoked just before the frame is shown. |
| 19 * @param {string} data Screen init payload. |
| 20 */ |
| 21 onBeforeShow: function(data) { |
| 22 this.updateApp(data['appInfo']); |
| 23 |
| 24 $('splash-shortcut-info').hidden = !data['shortcutEnabled']; |
| 25 |
| 26 Oobe.getInstance().headerHidden = true; |
| 27 }, |
| 28 |
| 29 /** |
| 30 * Event handler that is invoked just before the frame is hidden. |
| 31 */ |
| 32 onBeforeHide: function() { |
| 33 }, |
| 34 |
| 35 /** |
| 36 * Toggles visibility of the network configuration option. |
| 37 * @param {boolean} visible Whether to show the option. |
| 38 */ |
| 39 toggleNetworkConfig: function(visible) { |
| 40 // TODO(tengs): Implement network configuration in app launch. |
| 41 }, |
| 42 |
| 43 /** |
| 44 * Updates the app name and icon. |
| 45 * @param {Object} app Details of app being launched. |
| 46 */ |
| 47 updateApp: function(app) { |
| 48 $('splash-header').textContent = app.name; |
| 49 $('splash-header').style.backgroundImage = 'url(' + app.iconURL + ')'; |
| 50 }, |
| 51 |
| 52 /** |
| 53 * Updates the message for the current launch state. |
| 54 * @param {string} message Description for current launch state. |
| 55 */ |
| 56 updateMessage: function(message) { |
| 57 $('splash-launch-text').textContent = message; |
| 58 } |
| 59 }; |
| 60 }); |
OLD | NEW |