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 disableTextSelectAndDrag(); | |
xiyuan
2013/08/15 18:19:42
Don't think we need this. Select and drag should b
Tim Song
2013/08/16 19:07:59
Done. This is indeed the case.
| |
23 | |
24 this.updateApp(data['appInfo']); | |
25 | |
26 var shortcutEnabled = data['shortcutEnabled']; | |
27 $('splash-shortcut-info').hidden = | |
28 shortcutEnabled != null ? !shortcutEnabled : true; | |
xiyuan
2013/08/15 18:19:42
How could |shortcutEnabled| be null?
Tim Song
2013/08/16 19:07:59
Done. We'll always pass in this field when we show
| |
29 window.webkitRequestAnimationFrame(function() {}); | |
xiyuan
2013/08/15 18:19:42
This seems not needed.
Tim Song
2013/08/16 19:07:59
Done.
| |
30 | |
31 Oobe.getInstance().headerHidden = true; | |
32 }, | |
33 | |
34 /** | |
35 * Event handler that is invoked just before the frame is hidden. | |
36 */ | |
37 onBeforeHide: function() { | |
38 // Re-enable text select and drag. | |
39 disableTextSelectAndDrag(true, true); | |
xiyuan
2013/08/15 18:19:42
Why do we need to do it here?
Tim Song
2013/08/16 19:07:59
Done.
| |
40 }, | |
41 | |
42 /** | |
43 * Toggles visibility of the network configuration option. | |
44 * @param {boolean} visible Whether to show the option. | |
45 */ | |
46 toggleNetworkConfig: function(visible) { | |
47 // TODO(tengs): Implement network configuration in app launch. | |
48 }, | |
49 | |
50 /** | |
51 * Updates the app name and icon. | |
52 * @param {Object} app Details of app being launched. | |
53 */ | |
54 updateApp: function(app) { | |
55 $('splash-header').textContent = app.name; | |
56 $('splash-header').style.backgroundImage = 'url(' + app.iconURL + ')'; | |
57 }, | |
58 | |
59 /** | |
60 * Updates the message for the current launch state. | |
61 * @param {string} message Description for current launch state. | |
62 */ | |
63 updateMessage: function(message) { | |
64 $('splash-launch-text').textContent = message; | |
65 }, | |
xiyuan
2013/08/15 18:19:42
nit: no ',' for the last property.
Tim Song
2013/08/16 19:07:59
Done.
| |
66 }; | |
67 }); | |
OLD | NEW |