| 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 App install/launch splash screen implementation. | 6 * @fileoverview App install/launch splash screen implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 login.createScreen('AppLaunchSplashScreen', 'app-launch-splash', function() { | 9 login.createScreen('AppLaunchSplashScreen', 'app-launch-splash', function() { |
| 10 return { | 10 return { |
| 11 EXTERNAL_API: [ | 11 EXTERNAL_API: [ |
| 12 'toggleNetworkConfig', | 12 'toggleNetworkConfig', |
| 13 'updateApp', | 13 'updateApp', |
| 14 'updateMessage', | 14 'updateMessage', |
| 15 ], | 15 ], |
| 16 | 16 |
| 17 /** @override */ | 17 /** @override */ |
| 18 decorate: function() { | 18 decorate: function() { |
| 19 $('splash-config-network').addEventListener('click', function(e) { | 19 $('splash-config-network').addEventListener('click', function(e) { |
| 20 chrome.send('configureNetwork'); | 20 chrome.send('configureNetwork'); |
| 21 }); | 21 }); |
| 22 | 22 |
| 23 var networkContainer = $('splash-config-network-container'); | 23 var networkContainer = $('splash-config-network-container'); |
| 24 networkContainer.addEventListener( | 24 networkContainer.addEventListener( |
| 25 'webkitTransitionEnd', | 25 'transitionend', |
| 26 function(e) { | 26 function(e) { |
| 27 if (this.classList.contains('faded')) | 27 if (this.classList.contains('faded')) |
| 28 $('splash-config-network').hidden = true; | 28 $('splash-config-network').hidden = true; |
| 29 }.bind(networkContainer) | 29 }.bind(networkContainer) |
| 30 ); | 30 ); |
| 31 | 31 |
| 32 // Ensure the webkitTransitionEnd event gets called after a wait time. | 32 // Ensure the transitionend event gets called after a wait time. |
| 33 // The wait time should be inline with the transition duration 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 | 34 // defined in css file. The current value in css is 1000ms. To avoid |
| 35 // the emulated webkitTransitionEnd firing before real one, a 1050ms | 35 // the emulated transitionend firing before real one, a 1050ms |
| 36 // delay is used. | 36 // delay is used. |
| 37 ensureTransitionEndEvent(networkContainer, 1050); | 37 ensureTransitionEndEvent(networkContainer, 1050); |
| 38 }, | 38 }, |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Event handler that is invoked just before the frame is shown. | 41 * Event handler that is invoked just before the frame is shown. |
| 42 * @param {string} data Screen init payload. | 42 * @param {string} data Screen init payload. |
| 43 */ | 43 */ |
| 44 onBeforeShow: function(data) { | 44 onBeforeShow: function(data) { |
| 45 $('splash-config-network').hidden = true; | 45 $('splash-config-network').hidden = true; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 /** | 88 /** |
| 89 * Updates the message for the current launch state. | 89 * Updates the message for the current launch state. |
| 90 * @param {string} message Description for current launch state. | 90 * @param {string} message Description for current launch state. |
| 91 */ | 91 */ |
| 92 updateMessage: function(message) { | 92 updateMessage: function(message) { |
| 93 $('splash-launch-text').textContent = message; | 93 $('splash-launch-text').textContent = message; |
| 94 } | 94 } |
| 95 }; | 95 }; |
| 96 }); | 96 }); |
| OLD | NEW |