| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 */ | 172 */ |
| 173 forceKeyboardFlow_: false, | 173 forceKeyboardFlow_: false, |
| 174 | 174 |
| 175 /** | 175 /** |
| 176 * Whether virtual keyboard is shown. | 176 * Whether virtual keyboard is shown. |
| 177 * @type {boolean} | 177 * @type {boolean} |
| 178 */ | 178 */ |
| 179 virtualKeyboardShown_: false, | 179 virtualKeyboardShown_: false, |
| 180 | 180 |
| 181 /** | 181 /** |
| 182 * Virtual keyboard width. |
| 183 * @type {number} |
| 184 */ |
| 185 virtualKeyboardWidth_: 0, |
| 186 |
| 187 /** |
| 188 * Virtual keyboard height. |
| 189 * @type {number} |
| 190 */ |
| 191 virtualKeyboardHeight_: 0, |
| 192 |
| 193 /** |
| 182 * Type of UI. | 194 * Type of UI. |
| 183 * @type {string} | 195 * @type {string} |
| 184 */ | 196 */ |
| 185 displayType_: DISPLAY_TYPE.UNKNOWN, | 197 displayType_: DISPLAY_TYPE.UNKNOWN, |
| 186 | 198 |
| 187 /** | 199 /** |
| 188 * Error message (bubble) was shown. This is checked in tests. | 200 * Error message (bubble) was shown. This is checked in tests. |
| 189 */ | 201 */ |
| 190 errorMessageWasShownForTesting_: false, | 202 errorMessageWasShownForTesting_: false, |
| 191 | 203 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 */ | 249 */ |
| 238 get virtualKeyboardShown() { | 250 get virtualKeyboardShown() { |
| 239 return this.virtualKeyboardShown_; | 251 return this.virtualKeyboardShown_; |
| 240 }, | 252 }, |
| 241 | 253 |
| 242 set virtualKeyboardShown(shown) { | 254 set virtualKeyboardShown(shown) { |
| 243 this.virtualKeyboardShown_ = shown; | 255 this.virtualKeyboardShown_ = shown; |
| 244 }, | 256 }, |
| 245 | 257 |
| 246 /** | 258 /** |
| 259 * Sets the current size of the virtual keyboard. |
| 260 * @param {number} width keyboard width |
| 261 * @param {number} height keyboard height |
| 262 */ |
| 263 setVirtualKeyboardSize: function(width, height) { |
| 264 this.virtualKeyboardWidth_ = width; |
| 265 this.virtualKeyboardHeight_ = height; |
| 266 |
| 267 // Special case for screen lock. http://crbug.com/377904 |
| 268 // In case of virtual keyboard adjuct work area. |
| 269 if (this.displayType == DISPLAY_TYPE.LOCK) { |
| 270 var bottom = (height) ? height : $('login-header-bar').offsetHeight; |
| 271 var clientArea = $('outer-container'); |
| 272 clientArea.style.bottom = cr.ui.toCssPx(bottom); |
| 273 } |
| 274 }, |
| 275 |
| 276 /** |
| 247 * Sets the current size of the client area (display size). | 277 * Sets the current size of the client area (display size). |
| 248 * @param {number} width client area width | 278 * @param {number} width client area width |
| 249 * @param {number} height client area height | 279 * @param {number} height client area height |
| 250 */ | 280 */ |
| 251 setClientAreaSize: function(width, height) { | 281 setClientAreaSize: function(width, height) { |
| 252 var clientArea = $('outer-container'); | 282 var clientArea = $('outer-container'); |
| 253 var bottom = parseInt(window.getComputedStyle(clientArea).bottom); | 283 var bottom = parseInt(window.getComputedStyle(clientArea).bottom); |
| 254 clientArea.style.minHeight = (height - bottom) + 'px'; | 284 clientArea.style.minHeight = cr.ui.toCssPx(height - bottom); |
| 255 }, | 285 }, |
| 256 | 286 |
| 257 /** | 287 /** |
| 258 * Toggles background of main body between transparency and solid. | 288 * Toggles background of main body between transparency and solid. |
| 259 * @param {boolean} solid Whether to show a solid background. | 289 * @param {boolean} solid Whether to show a solid background. |
| 260 */ | 290 */ |
| 261 set solidBackground(solid) { | 291 set solidBackground(solid) { |
| 262 if (solid) | 292 if (solid) |
| 263 document.body.classList.add('solid'); | 293 document.body.classList.add('solid'); |
| 264 else | 294 else |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 */ | 1025 */ |
| 996 DisplayManager.refocusCurrentPod = function() { | 1026 DisplayManager.refocusCurrentPod = function() { |
| 997 $('pod-row').refocusCurrentPod(); | 1027 $('pod-row').refocusCurrentPod(); |
| 998 }; | 1028 }; |
| 999 | 1029 |
| 1000 // Export | 1030 // Export |
| 1001 return { | 1031 return { |
| 1002 DisplayManager: DisplayManager | 1032 DisplayManager: DisplayManager |
| 1003 }; | 1033 }; |
| 1004 }); | 1034 }); |
| OLD | NEW |