Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 705 var screen = $(screenId); | 705 var screen = $(screenId); |
| 706 var buttonStrip = $(screenId + '-controls'); | 706 var buttonStrip = $(screenId + '-controls'); |
| 707 if (buttonStrip) | 707 if (buttonStrip) |
| 708 buttonStrip.innerHTML = ''; | 708 buttonStrip.innerHTML = ''; |
| 709 // TODO(nkostylev): Update screen headers for new OOBE design. | 709 // TODO(nkostylev): Update screen headers for new OOBE design. |
| 710 this.appendButtons_(screen.buttons, screenId); | 710 this.appendButtons_(screen.buttons, screenId); |
| 711 if (screen.updateLocalizedContent) | 711 if (screen.updateLocalizedContent) |
| 712 screen.updateLocalizedContent(); | 712 screen.updateLocalizedContent(); |
| 713 } | 713 } |
| 714 | 714 |
| 715 /* Recalculate all MD containers */ | |
|
michaelpg
2016/08/15 16:16:50
why? and AFAICT there's only 1
Alexander Alekseev
2016/08/15 19:36:43
This code was needed because MD elements had 'posi
| |
| 716 var nodes = document.getElementsByClassName("md-container"); | |
| 717 for (var i = 0; i < nodes.length; ++i) { | |
| 718 var children = nodes[i].children; | |
| 719 var width = 0; | |
| 720 var height = 0; | |
| 721 for (var j = 0; j < children.length; ++j) { | |
| 722 width = Math.max(width, children[j].offsetWidth); | |
|
michaelpg
2016/08/15 16:16:50
offsetWidth or clientWidth?
| |
| 723 height = Math.max(height, children[j].offsetHeight); | |
| 724 } | |
| 725 nodes[i].style.width = width + 'px'; | |
| 726 nodes[i].style.height = height + 'px'; | |
| 727 } | |
| 728 | |
| 715 var currentScreenId = this.screens_[this.currentStep_]; | 729 var currentScreenId = this.screens_[this.currentStep_]; |
| 716 var currentScreen = $(currentScreenId); | 730 var currentScreen = $(currentScreenId); |
| 717 this.updateScreenSize(currentScreen); | 731 this.updateScreenSize(currentScreen); |
| 718 | 732 |
| 719 // Trigger network drop-down to reload its state | 733 // Trigger network drop-down to reload its state |
| 720 // so that strings are reloaded. | 734 // so that strings are reloaded. |
| 721 // Will be reloaded if drowdown is actually shown. | 735 // Will be reloaded if drowdown is actually shown. |
| 722 cr.ui.DropDown.refresh(); | 736 cr.ui.DropDown.refresh(); |
| 723 }, | 737 }, |
| 724 | 738 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1046 */ | 1060 */ |
| 1047 DisplayManager.refocusCurrentPod = function() { | 1061 DisplayManager.refocusCurrentPod = function() { |
| 1048 $('pod-row').refocusCurrentPod(); | 1062 $('pod-row').refocusCurrentPod(); |
| 1049 }; | 1063 }; |
| 1050 | 1064 |
| 1051 // Export | 1065 // Export |
| 1052 return { | 1066 return { |
| 1053 DisplayManager: DisplayManager | 1067 DisplayManager: DisplayManager |
| 1054 }; | 1068 }; |
| 1055 }); | 1069 }); |
| OLD | NEW |