summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorPavel Sergeev <dzhioev@chromium.org>2014-08-25 15:40:34 +0400
committerPavel Sergeev <dzhioev@chromium.org>2014-08-25 11:42:11 +0000
commit8088f4474fe172bba372f106b9de028abf346104 (patch)
tree192db941e66505f4d2ecee19820a044bb7a93238 /ui
parentd89d408c626e2d0a00cce3ea8304a625f5fce5b9 (diff)
downloadchromium_src-8088f4474fe172bba372f106b9de028abf346104.zip
chromium_src-8088f4474fe172bba372f106b9de028abf346104.tar.gz
chromium_src-8088f4474fe172bba372f106b9de028abf346104.tar.bz2
Desktop user manager focuses correct pod on load.
BUG=404659 TEST=manually Review URL: https://codereview.chromium.org/488563002 Cr-Commit-Position: refs/heads/master@{#290674} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290674 0039d316-1c4b-4281-b951-d872f2087c98 (cherry picked from commit 29cf49f00c4e6c8a4cb92fbfdb9d51398bc775df) Review URL: https://codereview.chromium.org/502963002 Cr-Commit-Position: refs/branch-heads/2125@{#73} Cr-Branched-From: b68026d94bda36dd106a3d91a098719f952a9477-refs/heads/master@{#290040}
Diffstat (limited to 'ui')
-rw-r--r--ui/login/OWNERS1
-rw-r--r--ui/login/account_picker/screen_account_picker.js9
-rw-r--r--ui/login/account_picker/user_pod_row.js26
3 files changed, 13 insertions, 23 deletions
diff --git a/ui/login/OWNERS b/ui/login/OWNERS
index 3bb7f34..6d721d28 100644
--- a/ui/login/OWNERS
+++ b/ui/login/OWNERS
@@ -4,3 +4,4 @@ ygorshenin@chromium.org
antrim@chromium.org
dzhioev@chromium.org
merkulova@chromium.org
+noms@chromium.org
diff --git a/ui/login/account_picker/screen_account_picker.js b/ui/login/account_picker/screen_account_picker.js
index 69e922a..e1dbd66 100644
--- a/ui/login/account_picker/screen_account_picker.js
+++ b/ui/login/account_picker/screen_account_picker.js
@@ -177,15 +177,6 @@ login.createScreen('AccountPickerScreen', 'account-picker', function() {
loadUsers: function(users, showGuest) {
$('pod-row').loadPods(users);
$('login-header-bar').showGuestButton = showGuest;
-
- // The desktop User Manager can send the index of a pod that should be
- // initially focused.
- var hash = window.location.hash;
- if (hash) {
- var podIndex = hash.substr(1);
- if (podIndex)
- $('pod-row').focusPodByIndex(podIndex, false);
- }
},
/**
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index 39b5c7d..bebb45e 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -2497,17 +2497,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() {
@@ -2550,11 +2539,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)