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

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

Issue 488563002: Desktop user manager focuses correct pod on load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not focus first pod by default. Created 6 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
« no previous file with comments | « ui/login/account_picker/screen_account_picker.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e83344b2bb6f31911e7e9316ffa64b8740b5ef83..6828093a94a1f4cfc9d3376d92de2649e0775c57 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -2630,17 +2630,6 @@ cr.define('login', function() {
},
/**
- * Focuses a given user pod by index or clear focus when given null.
- * @param {int=} podToFocus index of User pod to focus.
- * @param {boolean=} opt_force If true, forces focus update even when
- * podToFocus is already focused.
- */
- focusPodByIndex: function(podToFocus, opt_force) {
- if (podToFocus < this.pods.length)
- this.focusPod(this.pods[podToFocus], opt_force);
- },
-
- /**
* Resets wallpaper to the last active user's wallpaper, if any.
*/
loadLastWallpaper: function() {
@@ -2683,11 +2672,20 @@ cr.define('login', function() {
* @type {?UserPod}
*/
get preselectedPod() {
- // On desktop, don't pre-select a pod if it's the only one.
var isDesktopUserManager = Oobe.getInstance().displayType ==
DISPLAY_TYPE.DESKTOP_USER_MANAGER;
- if (isDesktopUserManager && this.pods.length == 1)
- return null;
+ if (isDesktopUserManager) {
+ // On desktop, don't pre-select a pod if it's the only one.
+ if (this.pods.length == 1)
+ return null;
+
+ // The desktop User Manager can send the index of a pod that should be
+ // initially focused in url hash.
+ var podIndex = parseInt(window.location.hash.substr(1));
+ if (isNaN(podIndex) || podIndex >= this.pods.length)
+ return null;
+ return this.pods[podIndex];
+ }
var lockedPod = this.lockedPod;
if (lockedPod)
« no previous file with comments | « ui/login/account_picker/screen_account_picker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698