| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 Offline message screen implementation. | 6 * @fileoverview Offline message screen implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 // Screens that should have offline message overlay. | 10 // Screens that should have offline message overlay. |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 if (!currentScreen.classList.contains('faded')) { | 236 if (!currentScreen.classList.contains('faded')) { |
| 237 currentScreen.classList.add('faded'); | 237 currentScreen.classList.add('faded'); |
| 238 currentScreen.addEventListener('webkitTransitionEnd', | 238 currentScreen.addEventListener('webkitTransitionEnd', |
| 239 function f(e) { | 239 function f(e) { |
| 240 currentScreen.removeEventListener('webkitTransitionEnd', f); | 240 currentScreen.removeEventListener('webkitTransitionEnd', f); |
| 241 if (currentScreen.classList.contains('faded')) | 241 if (currentScreen.classList.contains('faded')) |
| 242 currentScreen.classList.add('hidden'); | 242 currentScreen.classList.add('hidden'); |
| 243 }); | 243 }); |
| 244 } | 244 } |
| 245 chrome.send('networkErrorShown'); | 245 chrome.send('networkErrorShown'); |
| 246 // Report back error screen UI being painted. |
| 247 window.webkitRequestAnimationFrame(function() { |
| 248 chrome.send('loginVisible'); |
| 249 }); |
| 246 } else { | 250 } else { |
| 247 chrome.send('hideCaptivePortal'); | 251 chrome.send('hideCaptivePortal'); |
| 248 | 252 |
| 249 if (!offlineMessage.classList.contains('faded')) { | 253 if (!offlineMessage.classList.contains('faded')) { |
| 250 console.log('Hide offline message. state=' + state + | 254 console.log('Hide offline message. state=' + state + |
| 251 ', network=' + network + ', reason=' + reason); | 255 ', network=' + network + ', reason=' + reason); |
| 252 | 256 |
| 253 offlineMessage.onBeforeHide(); | 257 offlineMessage.onBeforeHide(); |
| 254 | 258 |
| 255 offlineMessage.classList.add('faded'); | 259 offlineMessage.classList.add('faded'); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 * via template. | 343 * via template. |
| 340 */ | 344 */ |
| 341 ErrorMessageScreen.updateLocalizedContent = function() { | 345 ErrorMessageScreen.updateLocalizedContent = function() { |
| 342 $('error-message').updateLocalizedContent_(); | 346 $('error-message').updateLocalizedContent_(); |
| 343 }; | 347 }; |
| 344 | 348 |
| 345 return { | 349 return { |
| 346 ErrorMessageScreen: ErrorMessageScreen | 350 ErrorMessageScreen: ErrorMessageScreen |
| 347 }; | 351 }; |
| 348 }); | 352 }); |
| OLD | NEW |