Remove the old signature of NotificationManager::closePersistent().
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / login / screen_app_launch_splash.js
blob6d01722e43d7dbe7e0446553d93fedf6d3ecb1f6
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
3 // found in the LICENSE file.
5 /**
6 * @fileoverview App install/launch splash screen implementation.
7 */
9 login.createScreen('AppLaunchSplashScreen', 'app-launch-splash', function() {
10 return {
11 EXTERNAL_API: [
12 'toggleNetworkConfig',
13 'updateApp',
14 'updateMessage',
17 /** @override */
18 decorate: function() {
19 $('splash-config-network').addEventListener('click', function(e) {
20 chrome.send('configureNetwork');
21 });
23 var networkContainer = $('splash-config-network-container');
24 networkContainer.addEventListener(
25 'webkitTransitionEnd',
26 function(e) {
27 if (this.classList.contains('faded'))
28 $('splash-config-network').hidden = true;
29 }.bind(networkContainer)
32 // Ensure the webkitTransitionEnd event gets called after a wait time.
33 // The wait time should be inline with the transition duration time
34 // defined in css file. The current value in css is 1000ms. To avoid
35 // the emulated webkitTransitionEnd firing before real one, a 1050ms
36 // delay is used.
37 ensureTransitionEndEvent(networkContainer, 1050);
40 /**
41 * Event handler that is invoked just before the frame is shown.
42 * @param {string} data Screen init payload.
44 onBeforeShow: function(data) {
45 $('splash-config-network').hidden = true;
46 this.toggleNetworkConfig(false);
47 this.updateApp(data['appInfo']);
49 $('splash-shortcut-info').hidden = !data['shortcutEnabled'];
51 Oobe.getInstance().headerHidden = true;
52 Oobe.getInstance().solidBackground = true;
55 /**
56 * Event handler that is invoked just before the frame is hidden.
58 onBeforeHide: function() {
61 /**
62 * Toggles visibility of the network configuration option.
63 * @param {boolean} visible Whether to show the option.
65 toggleNetworkConfig: function(visible) {
66 var container = $('splash-config-network-container');
67 var currVisible = !container.classList.contains('faded');
68 if (currVisible == visible)
69 return;
71 if (visible) {
72 $('splash-config-network').hidden = false;
73 container.classList.remove('faded');
74 } else {
75 container.classList.add('faded');
79 /**
80 * Updates the app name and icon.
81 * @param {Object} app Details of app being launched.
83 updateApp: function(app) {
84 $('splash-header').textContent = app.name;
85 $('splash-header').style.backgroundImage = 'url(' + app.iconURL + ')';
88 /**
89 * Updates the message for the current launch state.
90 * @param {string} message Description for current launch state.
92 updateMessage: function(message) {
93 $('splash-launch-text').textContent = message;
96 });