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

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 Dan's comments 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..d1ae7cc8de339d5e1afa2bab2f7933bf5cef47c0 100644
--- a/chrome/browser/resources/md_user_manager/user_manager.js
+++ b/chrome/browser/resources/md_user_manager/user_manager.js
@@ -14,6 +14,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 +31,22 @@ cr.define('cr.ui', function() {
UserManager.prototype = {
__proto__: DisplayManager.prototype,
+
+ /**
+ * @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 animatedPages = $('animatedPages');
+ var width = animatedPages.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 = animatedPages.offsetHeight - MAX_LOGIN_HEADER_BAR_HEIGHT;
+ return {width: width, height: height};
+ }
};
/**

Powered by Google App Engine
This is Rietveld 408576698