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

Unified Diff: ui/login/account_picker/user_pod_row.js

Issue 2222583002: Lock screen pin keyboard ui upgrades. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 4 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: ui/login/account_picker/user_pod_row.js
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index 0027539c251c7c9d745b89b4aa20ee1039acd24a..ac87243a91eb68d51240fe5641ee0f0a97af06dd 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -59,9 +59,8 @@ cr.define('login', function() {
var POD_ROW_PADDING = 10;
var DESKTOP_ROW_PADDING = 32;
var CUSTOM_ICON_CONTAINER_SIZE = 40;
- var CROS_PIN_POD_WIDTH = 270;
- var CROS_PIN_POD_HEIGHT = 594;
- var PIN_EXTRA_WIDTH = 90;
+ var CROS_PIN_POD_WIDTH = 180;
jdufault 2016/08/05 21:58:52 Can we eliminate this variable entirely, or set it
sammiequon 2016/08/05 23:34:50 Done.
+ var CROS_PIN_POD_HEIGHT = 417;
/**
* Minimal padding between user pod and virtual keyboard.
@@ -2395,6 +2394,9 @@ cr.define('login', function() {
// True if inside focusPod().
insideFocusPod_: false,
+ // Whether the pin keyboard has been loaded.
+ pinKeyboardLoaded_: false,
+
// Focused pod.
focusedPod_: undefined,
@@ -2550,6 +2552,7 @@ cr.define('login', function() {
},
setFocusedPodPinVisibility: function(visible) {
+ this.pinKeyboardLoaded_ = true;
jdufault 2016/08/05 21:58:52 Can we just query the DOM and see if there is cont
sammiequon 2016/08/05 23:34:50 Done. For multiple pods we want the keyboard to ex
if (this.focusedPod_ && this.focusedPod_.user.showPin)
this.focusedPod_.setPinVisibility(visible);
},
@@ -2965,28 +2968,6 @@ cr.define('login', function() {
},
/**
- * Calculates the row and column of the given |pod|.
- * @param {UserPod} pod Pod we want the row and column of.
- * @param {number} columns Columns in the podrow.
- * @param {number} rows Rows in the podrow.
- * @return {{columns: number, rows: number}}
- * @private
- */
- findPodLocation_: function(pod, columns, rows) {
- var column = -1;
- var row = -1;
- var index = this.pods.indexOf(pod);
- if (index >= 0) {
- row = Math.floor(index / columns);
- column = index % columns;
- }
- else {
- console.error('Pod not found in pod row.');
- }
- return {column: column, row: row};
- },
-
- /**
* Places pods onto their positions onto pod grid.
* @private
*/
@@ -3028,16 +3009,10 @@ cr.define('login', function() {
}
var column = index % columns;
var row = Math.floor(index / columns);
- var offsetFromPin = 0;
- if (row == pinPodLocation.row) {
- offsetFromPin = PIN_EXTRA_WIDTH / 2;
- if (column <= pinPodLocation.column)
- offsetFromPin *= -1;
- }
var rowPadding = isDesktopUserManager ? DESKTOP_ROW_PADDING :
POD_ROW_PADDING;
- pod.left = rowPadding + column * (width + margin) + offsetFromPin;
+ pod.left = rowPadding + column * (width + margin);
// On desktop, we want the rows to always be equally spaced.
pod.top = isDesktopUserManager ? row * (height + rowPadding) :
@@ -3126,7 +3101,9 @@ cr.define('login', function() {
var hadFocus = !!this.focusedPod_;
this.focusedPod_ = podToFocus;
if (podToFocus) {
- this.setFocusedPodPinVisibility(true);
+ // Only show the keyboard if it is fully loaded.
+ if (this.pinKeyboardLoaded_)
+ podToFocus.setPinVisibility(true);
podToFocus.classList.remove('faded');
podToFocus.classList.add('focused');
if (!podToFocus.multiProfilesPolicyApplied) {
@@ -3149,7 +3126,6 @@ cr.define('login', function() {
this.scrollFocusedPodIntoView();
}
this.insideFocusPod_ = false;
- this.placePods_();
},
jdufault 2016/08/05 21:58:52 Why the removal?
sammiequon 2016/08/05 23:34:50 This was added to support multiple pods and to re
/**
« ui/login/account_picker/user_pod_row.css ('K') | « ui/login/account_picker/user_pod_row.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698