Chromium Code Reviews| 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 is not visible therefore user-pods cannot be | |
| 34 * placed correctly. In that case we use the dimensions of |animatedPages| | |
| 35 * excluding header bar. | |
| 36 * @type {{width:string, height:string}} | |
| 37 */ | |
| 38 get clientAreaSize() { | |
| 39 width = $('outer-container').offsetWidth || | |
| 40 $('animatedPages').offsetWidth; | |
| 41 height = $('outer-container').offsetHeight || | |
| 42 $('animatedPages').offsetHeight - 57; | |
|
Roger Tawa OOO till Jul 10th
2016/02/10 15:58:29
Can you add a comment explain why 57?
Moe
2016/02/11 00:44:02
Done.
| |
| 43 return {width: width, height: height}; | |
| 44 } | |
| 30 }; | 45 }; |
| 31 | 46 |
| 32 /** | 47 /** |
| 33 * Shows the given screen. | 48 * Shows the given screen. |
| 34 * @param {boolean} showGuest True if |Browse as Guest| button should be | 49 * @param {boolean} showGuest True if |Browse as Guest| button should be |
| 35 * displayed. | 50 * displayed. |
| 36 * @param {boolean} showAddPerson True if |Add Person| button should be | 51 * @param {boolean} showAddPerson True if |Add Person| button should be |
| 37 * displayed. | 52 * displayed. |
| 38 */ | 53 */ |
| 39 Oobe.showUserManagerScreen = function(showGuest, showAddPerson) { | 54 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) | 157 // Allow selection events on components with editable text (password field) |
| 143 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 158 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
| 144 disableTextSelectAndDrag(function(e) { | 159 disableTextSelectAndDrag(function(e) { |
| 145 var src = e.target; | 160 var src = e.target; |
| 146 return src instanceof HTMLTextAreaElement || | 161 return src instanceof HTMLTextAreaElement || |
| 147 src instanceof HTMLInputElement && | 162 src instanceof HTMLInputElement && |
| 148 /text|password|search/.test(src.type); | 163 /text|password|search/.test(src.type); |
| 149 }); | 164 }); |
| 150 | 165 |
| 151 document.addEventListener('DOMContentLoaded', UserManager.initialize); | 166 document.addEventListener('DOMContentLoaded', UserManager.initialize); |
| OLD | NEW |