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 Display manager for WebUI OOBE and login. | 6 * @fileoverview Display manager for WebUI OOBE and login. |
7 */ | 7 */ |
8 | 8 |
9 // TODO(xiyuan): Find a better to share those constants. | 9 // TODO(xiyuan): Find a better to share those constants. |
10 /** @const */ var SCREEN_OOBE_NETWORK = 'connect'; | 10 /** @const */ var SCREEN_OOBE_NETWORK = 'connect'; |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 isOobeUI: function() { | 498 isOobeUI: function() { |
499 return !document.body.classList.contains('login-display'); | 499 return !document.body.classList.contains('login-display'); |
500 }, | 500 }, |
501 | 501 |
502 /** | 502 /** |
503 * Returns true if the current UI type is the "Sign-in to add user" | 503 * Returns true if the current UI type is the "Sign-in to add user" |
504 * (another user session is already active). | 504 * (another user session is already active). |
505 */ | 505 */ |
506 isSignInToAddScreen: function() { | 506 isSignInToAddScreen: function() { |
507 return document.documentElement.getAttribute('screen') == | 507 return document.documentElement.getAttribute('screen') == |
508 'login-add-user'; | 508 'user-adding'; |
509 }, | 509 }, |
510 | 510 |
511 /** | 511 /** |
512 * Returns true if the current UI type is the lock screen. | 512 * Returns true if the current UI type is the lock screen. |
513 */ | 513 */ |
514 isLockScreen: function() { | 514 isLockScreen: function() { |
515 return document.documentElement.getAttribute('screen') == 'lock'; | 515 return document.documentElement.getAttribute('screen') == 'lock'; |
516 }, | 516 }, |
517 | 517 |
518 /** | 518 /** |
519 * Returns true if sign in UI should trigger wallpaper load on boot. | 519 * Returns true if sign in UI should trigger wallpaper load on boot. |
520 */ | 520 */ |
521 shouldLoadWallpaperOnBoot: function() { | 521 shouldLoadWallpaperOnBoot: function() { |
522 return loadTimeData.getString('bootIntoWallpaper') == 'on'; | 522 return loadTimeData.getString('bootIntoWallpaper') == 'on'; |
523 }, | 523 }, |
524 }; | 524 }; |
525 | 525 |
526 /** | 526 /** |
527 * Initializes display manager. | 527 * Initializes display manager. |
528 */ | 528 */ |
529 DisplayManager.initialize = function() { | 529 DisplayManager.initialize = function() { |
| 530 // Extracting screen type from URL. |
| 531 var hash = window.location.hash; |
| 532 var screenType; |
| 533 if (!hash) { |
| 534 console.error('Screen type not found. Setting default value "login".'); |
| 535 screenType = 'login'; |
| 536 } else { |
| 537 screenType = hash.substring(1); |
| 538 } |
| 539 document.documentElement.setAttribute('screen', screenType); |
| 540 |
530 var link = $('enterprise-info-hint-link'); | 541 var link = $('enterprise-info-hint-link'); |
531 link.addEventListener( | 542 link.addEventListener( |
532 'click', DisplayManager.handleEnterpriseHintLinkClick); | 543 'click', DisplayManager.handleEnterpriseHintLinkClick); |
533 }, | 544 }, |
534 | 545 |
535 /** | 546 /** |
536 * Returns offset (top, left) of the element. | 547 * Returns offset (top, left) of the element. |
537 * @param {!Element} element HTML element. | 548 * @param {!Element} element HTML element. |
538 * @return {!Object} The offset (top, left). | 549 * @return {!Object} The offset (top, left). |
539 */ | 550 */ |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 */ | 722 */ |
712 DisplayManager.refocusCurrentPod = function() { | 723 DisplayManager.refocusCurrentPod = function() { |
713 $('pod-row').refocusCurrentPod(); | 724 $('pod-row').refocusCurrentPod(); |
714 }; | 725 }; |
715 | 726 |
716 // Export | 727 // Export |
717 return { | 728 return { |
718 DisplayManager: DisplayManager | 729 DisplayManager: DisplayManager |
719 }; | 730 }; |
720 }); | 731 }); |
OLD | NEW |