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 <include src="../../../../ui/login/screen.js"> | 5 <include src="../../../../ui/login/screen.js"> |
| 6 <include src="../../../../ui/login/bubble.js"> | 6 <include src="../../../../ui/login/bubble.js"> |
| 7 <include src="../../../../ui/login/login_ui_tools.js"> | 7 <include src="../../../../ui/login/login_ui_tools.js"> |
| 8 <include src="../../../../ui/login/display_manager.js"> | 8 <include src="../../../../ui/login/display_manager.js"> |
| 9 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> | 9 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> |
| 10 <include src="../../../../ui/login/account_picker/user_pod_row.js"> | 10 <include src="../../../../ui/login/account_picker/user_pod_row.js"> |
| 11 | 11 |
| 12 | 12 |
| 13 cr.define('cr.ui', function() { | 13 cr.define('cr.ui', function() { |
| 14 var DisplayManager = cr.ui.login.DisplayManager; | 14 var DisplayManager = cr.ui.login.DisplayManager; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Manages initialization of screens, transitions, and error messages. | 17 * Manages initialization of screens, transitions, and error messages. |
| 18 * @constructor | 18 * @constructor |
| 19 * @extends {DisplayManager} | 19 * @extends {DisplayManager} |
| 20 */ | 20 */ |
| 21 function UserManager() {} | 21 function UserManager() {} |
| 22 | 22 |
| 23 cr.addSingletonGetter(UserManager); | 23 cr.addSingletonGetter(UserManager); |
| 24 | 24 |
| 25 UserManager.prototype = { | 25 UserManager.prototype = { |
| 26 __proto__: DisplayManager.prototype, | 26 __proto__: DisplayManager.prototype, |
| 27 | |
| 28 /** | |
| 29 * @override | |
| 30 * Overrides clientAreaSize in DisplayManager. When a new profile is created | |
| 31 * the #outer-container page may not be visible yet, so user-pods cannot be | |
| 32 * placed correctly. In that case we use dimensions of the #animated-pages. | |
| 33 * @type {{width:string, height:string}} | |
|
tommycli
2016/03/11 18:59:14
I think it should be {width: string, height: strin
Moe
2016/03/15 21:28:20
Done.
| |
| 34 */ | |
| 35 get clientAreaSize() { | |
| 36 var outerContainer = $('outer-container'); | |
| 37 var animatedPages = $('animatedPages'); | |
| 38 var width = outerContainer.offsetWidth || animatedPages.offsetWidth; | |
| 39 // Deduct the maximum possible height of the #login-header-bar (including | |
| 40 // the padding and the border) from the height of #animated-pages. Result | |
| 41 // is the remaining visible height. | |
| 42 var height = outerContainer.offsetHeight || | |
| 43 animatedPages.offsetHeight - 57; | |
|
tommycli
2016/03/11 18:59:14
Can this '57' value be calculated from the element
Moe
2016/03/15 21:28:20
I removed the constant from the css file. Unfortun
| |
| 44 return {width: width, height: height}; | |
| 45 } | |
| 27 }; | 46 }; |
| 28 | 47 |
| 29 /** | 48 /** |
| 30 * Initializes the UserManager. | 49 * Initializes the UserManager. |
| 31 */ | 50 */ |
| 32 UserManager.initialize = function() { | 51 UserManager.initialize = function() { |
| 33 cr.ui.login.DisplayManager.initialize(); | 52 cr.ui.login.DisplayManager.initialize(); |
| 34 login.AccountPickerScreen.register(); | 53 login.AccountPickerScreen.register(); |
| 35 cr.ui.Bubble.decorate($('bubble')); | 54 cr.ui.Bubble.decorate($('bubble')); |
| 36 | 55 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 // Allow selection events on components with editable text (password field) | 131 // Allow selection events on components with editable text (password field) |
| 113 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 132 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
| 114 disableTextSelectAndDrag(function(e) { | 133 disableTextSelectAndDrag(function(e) { |
| 115 var src = e.target; | 134 var src = e.target; |
| 116 return src instanceof HTMLTextAreaElement || | 135 return src instanceof HTMLTextAreaElement || |
| 117 src instanceof HTMLInputElement && | 136 src instanceof HTMLInputElement && |
| 118 /text|password|search/.test(src.type); | 137 /text|password|search/.test(src.type); |
| 119 }); | 138 }); |
| 120 | 139 |
| 121 document.addEventListener('DOMContentLoaded', cr.ui.UserManager.initialize); | 140 document.addEventListener('DOMContentLoaded', cr.ui.UserManager.initialize); |
| OLD | NEW |