| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 Common OOBE controller methods. | 6 * @fileoverview Common OOBE controller methods. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 <include src="../../../../../ui/login/screen.js"> | 9 <include src="../../../../../ui/login/screen.js"> |
| 10 <include src="screen_context.js"> | 10 <include src="screen_context.js"> |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 /** | 321 /** |
| 322 * Sets the current size of the client area (display size). | 322 * Sets the current size of the client area (display size). |
| 323 * @param {number} width client area width | 323 * @param {number} width client area width |
| 324 * @param {number} height client area height | 324 * @param {number} height client area height |
| 325 */ | 325 */ |
| 326 Oobe.setClientAreaSize = function(width, height) { | 326 Oobe.setClientAreaSize = function(width, height) { |
| 327 Oobe.getInstance().setClientAreaSize(width, height); | 327 Oobe.getInstance().setClientAreaSize(width, height); |
| 328 }; | 328 }; |
| 329 | 329 |
| 330 /** |
| 331 * Computes max-height for an element so that it doesn't overlap shelf. |
| 332 * @param {element} DOM element |
| 333 */ |
| 334 Oobe.getMaxHeightBeforeShelfOverlapping = function(element) { |
| 335 var maxAllowedHeight = |
| 336 $('outer-container').offsetHeight - |
| 337 element.getBoundingClientRect().top - |
| 338 parseInt(window.getComputedStyle(element).marginTop) - |
| 339 parseInt(window.getComputedStyle(element).marginBottom); |
| 340 return maxAllowedHeight; |
| 341 }; |
| 342 |
| 330 // Export | 343 // Export |
| 331 return { | 344 return { |
| 332 Oobe: Oobe | 345 Oobe: Oobe |
| 333 }; | 346 }; |
| 334 }); | 347 }); |
| 335 | 348 |
| 336 var Oobe = cr.ui.Oobe; | 349 var Oobe = cr.ui.Oobe; |
| 337 | 350 |
| 338 // Allow selection events on components with editable text (password field) | 351 // Allow selection events on components with editable text (password field) |
| 339 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 352 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 361 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { | 374 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { |
| 362 // This screen is async-loaded so we manually trigger i18n processing. | 375 // This screen is async-loaded so we manually trigger i18n processing. |
| 363 i18nTemplate.process($('oauth-enrollment'), loadTimeData); | 376 i18nTemplate.process($('oauth-enrollment'), loadTimeData); |
| 364 // Delayed binding since this isn't defined yet. | 377 // Delayed binding since this isn't defined yet. |
| 365 login.OAuthEnrollmentScreen.register(); | 378 login.OAuthEnrollmentScreen.register(); |
| 366 }); | 379 }); |
| 367 | 380 |
| 368 // Delayed binding since this isn't defined yet. | 381 // Delayed binding since this isn't defined yet. |
| 369 cr.ui.Oobe.initialize(); | 382 cr.ui.Oobe.initialize(); |
| 370 }); | 383 }); |
| OLD | NEW |