| OLD | NEW |
| 1 /* Copyright 2016 The Chromium Authors. All rights reserved. | 1 /* Copyright 2016 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 <include src="../../../../ui/login/screen.js"> | 6 <include src="../../../../ui/login/screen.js"> |
| 7 <include src="../../../../ui/login/bubble.js"> | 7 <include src="../../../../ui/login/bubble.js"> |
| 8 <include src="../../../../ui/login/login_ui_tools.js"> | 8 <include src="../../../../ui/login/login_ui_tools.js"> |
| 9 <include src="../../../../ui/login/display_manager.js"> | 9 <include src="../../../../ui/login/display_manager.js"> |
| 10 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> | 10 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> |
| 11 <include src="../../../../ui/login/account_picker/user_pod_row.js"> | 11 <include src="../../../../ui/login/account_picker/user_pod_row.js"> |
| 12 <include src="../../../../ui/login/resource_loader.js"> | 12 <include src="../../../../ui/login/resource_loader.js"> |
| 13 | 13 |
| 14 | 14 |
| 15 cr.define('cr.ui', function() { | 15 cr.define('cr.ui', function() { |
| 16 var DisplayManager = cr.ui.login.DisplayManager; | 16 var DisplayManager = cr.ui.login.DisplayManager; |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * Constructs an Out of box controller. It manages initialization of screens, | 19 * Constructs an Out of box controller. It manages initialization of screens, |
| 20 * transitions, error messages display. | 20 * transitions, error messages display. |
| 21 * @constructor | 21 * @constructor |
| 22 * @extends {DisplayManager} | 22 * @extends {DisplayManager} |
| 23 */ | 23 */ |
| 24 function Oobe() {} | 24 function Oobe() {} |
| 25 | 25 |
| 26 cr.addSingletonGetter(Oobe); | 26 cr.addSingletonGetter(Oobe); |
| 27 | 27 |
| 28 Oobe.prototype = { | 28 Oobe.prototype = { |
| 29 __proto__: DisplayManager.prototype, | 29 __proto__: DisplayManager.prototype, |
| 30 |
| 31 /** |
| 32 * Overrides clientAreaSize in DisplayManager. When a new profile is created |
| 33 * the #outer-container page may not be visible yet, so user-pods cannot be |
| 34 * placed correctly. In that case we use dimensions of the #animated-pages. |
| 35 * @type {{width:string, height:string}} |
| 36 */ |
| 37 get clientAreaSize() { |
| 38 width = $('outer-container').offsetWidth || |
| 39 $('animated-pages').offsetWidth; |
| 40 // Deduct the maximum possible height of the #login-header-bar (including |
| 41 // the padding and the border) from the height of #animated-pages. Result |
| 42 // is the remaining visible height. |
| 43 height = $('outer-container').offsetHeight || |
| 44 $('animated-pages').offsetHeight - 57; |
| 45 return {width: width, height: height}; |
| 46 } |
| 30 }; | 47 }; |
| 31 | 48 |
| 32 /** | 49 /** |
| 33 * Shows the given screen. | 50 * Shows the given screen. |
| 34 * @param {boolean} showGuest True if |Browse as Guest| button should be | 51 * @param {boolean} showGuest True if |Browse as Guest| button should be |
| 35 * displayed. | 52 * displayed. |
| 36 * @param {boolean} showAddPerson True if |Add Person| button should be | 53 * @param {boolean} showAddPerson True if |Add Person| button should be |
| 37 * displayed. | 54 * displayed. |
| 38 */ | 55 */ |
| 39 Oobe.showUserManagerScreen = function(showGuest, showAddPerson) { | 56 Oobe.showUserManagerScreen = function(showGuest, showAddPerson) { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Allow selection events on components with editable text (password field) | 159 // Allow selection events on components with editable text (password field) |
| 143 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 160 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
| 144 disableTextSelectAndDrag(function(e) { | 161 disableTextSelectAndDrag(function(e) { |
| 145 var src = e.target; | 162 var src = e.target; |
| 146 return src instanceof HTMLTextAreaElement || | 163 return src instanceof HTMLTextAreaElement || |
| 147 src instanceof HTMLInputElement && | 164 src instanceof HTMLInputElement && |
| 148 /text|password|search/.test(src.type); | 165 /text|password|search/.test(src.type); |
| 149 }); | 166 }); |
| 150 | 167 |
| 151 document.addEventListener('DOMContentLoaded', UserManager.initialize); | 168 document.addEventListener('DOMContentLoaded', UserManager.initialize); |
| OLD | NEW |