Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome/browser/resources/md_user_manager/user_manager.js

Issue 1642323004: User Manager MD User Pods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments, fixed google colors Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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. Therefore, we use dimensions of the #animated-pages.
33 * @type {{width: string, height: string}}
34 */
35 get clientAreaSize() {
36 var animatedPages = $('animatedPages');
37 var width = animatedPages.offsetWidth;
38 // Deduct the maximum possible height of the #login-header-bar (including
39 // the padding and the border) from the height of #animated-pages. Result
40 // is the remaining visible height.
41 var height = animatedPages.offsetHeight - 57;
Dan Beam 2016/03/25 02:48:23 why the magic 57? can you get this dynamically or
Moe 2016/04/04 14:55:09 Done. Unfortunately, can't get this dynamically, s
42 return {width: width, height: height};
43 }
27 }; 44 };
28 45
29 /** 46 /**
30 * Initializes the UserManager. 47 * Initializes the UserManager.
31 */ 48 */
32 UserManager.initialize = function() { 49 UserManager.initialize = function() {
33 cr.ui.login.DisplayManager.initialize(); 50 cr.ui.login.DisplayManager.initialize();
34 login.AccountPickerScreen.register(); 51 login.AccountPickerScreen.register();
35 cr.ui.Bubble.decorate($('bubble')); 52 cr.ui.Bubble.decorate($('bubble'));
36 53
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Allow selection events on components with editable text (password field) 130 // Allow selection events on components with editable text (password field)
114 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) 131 // bug (http://code.google.com/p/chromium/issues/detail?id=125863)
115 disableTextSelectAndDrag(function(e) { 132 disableTextSelectAndDrag(function(e) {
116 var src = e.target; 133 var src = e.target;
117 return src instanceof HTMLTextAreaElement || 134 return src instanceof HTMLTextAreaElement ||
118 src instanceof HTMLInputElement && 135 src instanceof HTMLInputElement &&
119 /text|password|search/.test(src.type); 136 /text|password|search/.test(src.type);
120 }); 137 });
121 138
122 document.addEventListener('DOMContentLoaded', cr.ui.UserManager.initialize); 139 document.addEventListener('DOMContentLoaded', cr.ui.UserManager.initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698