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/user_pod_template.js"> | |
| 9 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> | 10 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> |
| 10 <include src="../../../../ui/login/account_picker/user_pod_row.js"> | 11 <include src="../../../../ui/login/account_picker/user_pod_row.js"> |
| 11 | 12 |
| 12 | 13 |
| 13 cr.define('cr.ui', function() { | 14 cr.define('cr.ui', function() { |
| 14 var DisplayManager = cr.ui.login.DisplayManager; | 15 var DisplayManager = cr.ui.login.DisplayManager; |
| 15 | 16 |
| 16 /** | 17 /** |
| 18 * Maximum possible height of the #login-header-bar, including the padding | |
| 19 * and the border. | |
| 20 * @const {number} | |
| 21 */ | |
| 22 var MAX_LOGIN_HEADER_BAR_HEIGHT = 57; | |
| 23 | |
| 24 /** | |
| 17 * Manages initialization of screens, transitions, and error messages. | 25 * Manages initialization of screens, transitions, and error messages. |
| 18 * @constructor | 26 * @constructor |
| 19 * @extends {DisplayManager} | 27 * @extends {DisplayManager} |
| 20 */ | 28 */ |
| 21 function UserManager() {} | 29 function UserManager() {} |
| 22 | 30 |
| 23 cr.addSingletonGetter(UserManager); | 31 cr.addSingletonGetter(UserManager); |
| 24 | 32 |
| 25 UserManager.prototype = { | 33 UserManager.prototype = { |
| 26 __proto__: DisplayManager.prototype, | 34 __proto__: DisplayManager.prototype, |
| 35 | |
| 36 /** | |
| 37 * @override | |
| 38 * @type {boolean} | |
| 39 */ | |
| 40 get newDesktopUserManager() { | |
| 41 return true; | |
| 42 }, | |
|
Dan Beam
2016/04/19 21:15:09
could this be just:
newDesktopUserManager: true
Moe
2016/04/20 15:29:38
yes. My bad. No need for this to be a computed pro
| |
| 43 | |
| 44 /** | |
| 45 * @override | |
| 46 * Overrides clientAreaSize in DisplayManager. When a new profile is created | |
| 47 * the #outer-container page may not be visible yet, so user-pods cannot be | |
| 48 * placed correctly. Therefore, we use dimensions of the #animated-pages. | |
| 49 * @type {{width: number, height: number}} | |
| 50 */ | |
| 51 get clientAreaSize() { | |
| 52 var userManagerPages = document.querySelector('user-manager-pages'); | |
| 53 var width = userManagerPages.offsetWidth; | |
| 54 // Deduct the maximum possible height of the #login-header-bar from the | |
| 55 // height of #animated-pages. Result is the remaining visible height. | |
| 56 var height = userManagerPages.offsetHeight - MAX_LOGIN_HEADER_BAR_HEIGHT; | |
| 57 return {width: width, height: height}; | |
| 58 } | |
| 27 }; | 59 }; |
| 28 | 60 |
| 29 /** | 61 /** |
| 30 * Initializes the UserManager. | 62 * Initializes the UserManager. |
| 31 */ | 63 */ |
| 32 UserManager.initialize = function() { | 64 UserManager.initialize = function() { |
| 33 cr.ui.login.DisplayManager.initialize(); | 65 cr.ui.login.DisplayManager.initialize(); |
| 34 login.AccountPickerScreen.register(); | 66 login.AccountPickerScreen.register(); |
| 35 cr.ui.Bubble.decorate($('bubble')); | 67 cr.ui.Bubble.decorate($('bubble')); |
| 36 | 68 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 // Allow selection events on components with editable text (password field) | 146 // Allow selection events on components with editable text (password field) |
| 115 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 147 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
| 116 disableTextSelectAndDrag(function(e) { | 148 disableTextSelectAndDrag(function(e) { |
| 117 var src = e.target; | 149 var src = e.target; |
| 118 return src instanceof HTMLTextAreaElement || | 150 return src instanceof HTMLTextAreaElement || |
| 119 src instanceof HTMLInputElement && | 151 src instanceof HTMLInputElement && |
| 120 /text|password|search/.test(src.type); | 152 /text|password|search/.test(src.type); |
| 121 }); | 153 }); |
| 122 | 154 |
| 123 document.addEventListener('DOMContentLoaded', cr.ui.UserManager.initialize); | 155 document.addEventListener('DOMContentLoaded', cr.ui.UserManager.initialize); |
| OLD | NEW |