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

Unified 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 a couple of issues with the existing user manager (overflowing user pod r… Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_user_manager/user_manager.js
diff --git a/chrome/browser/resources/md_user_manager/user_manager.js b/chrome/browser/resources/md_user_manager/user_manager.js
index caaf404f0a4a55fe673542128c521540944b914d..7065962e9987363f5b5a6df165f2577fff597e3b 100644
--- a/chrome/browser/resources/md_user_manager/user_manager.js
+++ b/chrome/browser/resources/md_user_manager/user_manager.js
@@ -6,6 +6,7 @@
<include src="../../../../ui/login/bubble.js">
<include src="../../../../ui/login/login_ui_tools.js">
<include src="../../../../ui/login/display_manager.js">
+<include src="../../../../ui/login/account_picker/user_pod_template.js">
<include src="../../../../ui/login/account_picker/screen_account_picker.js">
<include src="../../../../ui/login/account_picker/user_pod_row.js">
@@ -14,6 +15,13 @@ cr.define('cr.ui', function() {
var DisplayManager = cr.ui.login.DisplayManager;
/**
+ * Maximum possible height of the #login-header-bar, including the padding
+ * and the border.
+ * @const {number}
+ */
+ var MAX_LOGIN_HEADER_BAR_HEIGHT = 57;
+
+ /**
* Manages initialization of screens, transitions, and error messages.
* @constructor
* @extends {DisplayManager}
@@ -24,6 +32,30 @@ cr.define('cr.ui', function() {
UserManager.prototype = {
__proto__: DisplayManager.prototype,
+
+ /**
+ * @override
+ * @type {boolean}
+ */
+ get newDesktopUserManager() {
+ return true;
+ },
+
+ /**
+ * @override
+ * Overrides clientAreaSize in DisplayManager. When a new profile is created
+ * the #outer-container page may not be visible yet, so user-pods cannot be
+ * placed correctly. Therefore, we use dimensions of the #animated-pages.
+ * @type {{width: number, height: number}}
+ */
+ get clientAreaSize() {
+ var userManagerPages = document.querySelector('user-manager-pages');
+ var width = userManagerPages.offsetWidth;
+ // Deduct the maximum possible height of the #login-header-bar from the
+ // height of #animated-pages. Result is the remaining visible height.
+ var height = userManagerPages.offsetHeight - MAX_LOGIN_HEADER_BAR_HEIGHT;
+ return {width: width, height: height};
+ }
};
/**

Powered by Google App Engine
This is Rietveld 408576698