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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 function f(e) { | 215 function f(e) { |
216 offlineMessage.removeEventListener('webkitTransitionEnd', f); | 216 offlineMessage.removeEventListener('webkitTransitionEnd', f); |
217 if (offlineMessage.classList.contains('faded')) | 217 if (offlineMessage.classList.contains('faded')) |
218 offlineMessage.classList.add('hidden'); | 218 offlineMessage.classList.add('hidden'); |
219 }); | 219 }); |
220 } else { | 220 } else { |
221 offlineMessage.classList.add('hidden'); | 221 offlineMessage.classList.add('hidden'); |
222 } | 222 } |
223 } | 223 } |
224 }, | 224 }, |
225 | |
226 // Request network state update with loading timeout as reason. | |
227 showLoadingTimeoutError: function() { | |
228 // Shows error message if it is not shown already. | |
229 if (this.classList.contains('hidden')) { | |
230 chrome.send('loginRequestNetworkState', | |
231 ['login.ErrorMessageScreen.updateState', | |
232 ERROR_REASONS.LOADING_TIMEOUT]); | |
233 } | |
234 } | |
235 }; | 225 }; |
236 | 226 |
237 /** | 227 /** |
238 * Prepares error screen to show proxy error. | 228 * Prepares error screen to show proxy error. |
239 */ | 229 */ |
240 ErrorMessageScreen.showProxyError = function() { | 230 ErrorMessageScreen.showProxyError = function() { |
241 $('error-message').showProxyError_(); | 231 $('error-message').showProxyError_(); |
242 }; | 232 }; |
243 | 233 |
244 /** | 234 /** |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 * via template. | 311 * via template. |
322 */ | 312 */ |
323 ErrorMessageScreen.updateLocalizedContent = function() { | 313 ErrorMessageScreen.updateLocalizedContent = function() { |
324 $('error-message').updateLocalizedContent_(); | 314 $('error-message').updateLocalizedContent_(); |
325 }; | 315 }; |
326 | 316 |
327 return { | 317 return { |
328 ErrorMessageScreen: ErrorMessageScreen | 318 ErrorMessageScreen: ErrorMessageScreen |
329 }; | 319 }; |
330 }); | 320 }); |
OLD | NEW |