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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 */ | 166 */ |
167 allowToggleVersion_: false, | 167 allowToggleVersion_: false, |
168 | 168 |
169 /** | 169 /** |
170 * Whether keyboard navigation flow is enforced. | 170 * Whether keyboard navigation flow is enforced. |
171 * @type {boolean} | 171 * @type {boolean} |
172 */ | 172 */ |
173 forceKeyboardFlow_: false, | 173 forceKeyboardFlow_: false, |
174 | 174 |
175 /** | 175 /** |
176 * Whether virtual keyboard is shown. | |
177 * @type {boolean} | |
178 */ | |
179 virtualKeyboardShown_: false, | |
180 | |
181 /** | |
176 * Type of UI. | 182 * Type of UI. |
177 * @type {string} | 183 * @type {string} |
178 */ | 184 */ |
179 displayType_: DISPLAY_TYPE.UNKNOWN, | 185 displayType_: DISPLAY_TYPE.UNKNOWN, |
180 | 186 |
181 /** | 187 /** |
182 * Error message (bubble) was shown. This is checked in tests. | 188 * Error message (bubble) was shown. This is checked in tests. |
183 */ | 189 */ |
184 errorMessageWasShownForTesting_: false, | 190 errorMessageWasShownForTesting_: false, |
185 | 191 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
219 */ | 225 */ |
220 get headerHidden() { | 226 get headerHidden() { |
221 return $('login-header-bar').hidden; | 227 return $('login-header-bar').hidden; |
222 }, | 228 }, |
223 | 229 |
224 set headerHidden(hidden) { | 230 set headerHidden(hidden) { |
225 $('login-header-bar').hidden = hidden; | 231 $('login-header-bar').hidden = hidden; |
226 }, | 232 }, |
227 | 233 |
228 /** | 234 /** |
235 * Virtual keyboard state (hidden/shown). | |
236 * @param {boolean} hidden Whether keyboard is shown. | |
237 */ | |
238 get virtualKeyboardShown() { | |
239 return this.virtualKeyboardShown_; | |
240 }, | |
241 | |
242 set virtualKeyboardShown(shown) { | |
243 this.virtualKeyboardShown_ = shown; | |
244 }, | |
245 | |
246 /** | |
229 * Toggles background of main body between transparency and solid. | 247 * Toggles background of main body between transparency and solid. |
230 * @param {boolean} solid Whether to show a solid background. | 248 * @param {boolean} solid Whether to show a solid background. |
231 */ | 249 */ |
232 set solidBackground(solid) { | 250 set solidBackground(solid) { |
233 if (solid) | 251 if (solid) |
234 document.body.classList.add('solid'); | 252 document.body.classList.add('solid'); |
235 else | 253 else |
236 document.body.classList.remove('solid'); | 254 document.body.classList.remove('solid'); |
237 }, | 255 }, |
238 | 256 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
702 chrome.send('setDeviceRequisition', [value == '' ? 'none' : value]); | 720 chrome.send('setDeviceRequisition', [value == '' ? 'none' : value]); |
703 }, | 721 }, |
704 | 722 |
705 /** | 723 /** |
706 * Called when window size changed. Notifies current screen about change. | 724 * Called when window size changed. Notifies current screen about change. |
707 * @private | 725 * @private |
708 */ | 726 */ |
709 onWindowResize_: function() { | 727 onWindowResize_: function() { |
710 var currentScreenId = this.screens_[this.currentStep_]; | 728 var currentScreenId = this.screens_[this.currentStep_]; |
711 var currentScreen = $(currentScreenId); | 729 var currentScreen = $(currentScreenId); |
712 if (currentScreen) | 730 if (currentScreen && currentScreen.onWindowResize) |
dzhioev (left Google)
2014/05/21 17:30:32
Added check is not needed, because we have default
Nikita (slow)
2014/05/22 15:11:50
Cool, removed.
| |
713 currentScreen.onWindowResize(); | 731 currentScreen.onWindowResize(); |
714 }, | 732 }, |
715 | 733 |
716 /* | 734 /* |
717 * Updates the device requisition string shown in the requisition prompt. | 735 * Updates the device requisition string shown in the requisition prompt. |
718 * @param {string} requisition The device requisition. | 736 * @param {string} requisition The device requisition. |
719 */ | 737 */ |
720 updateDeviceRequisition: function(requisition) { | 738 updateDeviceRequisition: function(requisition) { |
721 this.deviceRequisition_ = requisition; | 739 this.deviceRequisition_ = requisition; |
722 }, | 740 }, |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
966 */ | 984 */ |
967 DisplayManager.refocusCurrentPod = function() { | 985 DisplayManager.refocusCurrentPod = function() { |
968 $('pod-row').refocusCurrentPod(); | 986 $('pod-row').refocusCurrentPod(); |
969 }; | 987 }; |
970 | 988 |
971 // Export | 989 // Export |
972 return { | 990 return { |
973 DisplayManager: DisplayManager | 991 DisplayManager: DisplayManager |
974 }; | 992 }; |
975 }); | 993 }); |
OLD | NEW |