| 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 c36496d08a4a503ebf0f7d286d8951430160ce45..eae6f1015017d6bc0f1803201103003b7d3f45ff 100644
|
| --- a/ui/login/account_picker/user_pod_row.js
|
| +++ b/ui/login/account_picker/user_pod_row.js
|
| @@ -3002,21 +3002,23 @@ cr.define('login', function() {
|
| 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];
|
| + // The desktop User Manager can send an URI encoded profile path in the
|
| + // url hash, that indicates a pod that should be initially focused.
|
| + var focusedProfilePath =
|
| + decodeURIComponent(window.location.hash.substr(1));
|
| + for (var i = 0, pod; pod = this.pods[i]; ++i) {
|
| + if (focusedProfilePath === pod.user.profilePath)
|
| + return pod;
|
| + }
|
| + return null;
|
| }
|
|
|
| var lockedPod = this.lockedPod;
|
| if (lockedPod)
|
| return lockedPod;
|
| - for (var i = 0, pod; pod = this.pods[i]; ++i) {
|
| - if (!pod.multiProfilesPolicyApplied) {
|
| + for (i = 0; pod = this.pods[i]; ++i) {
|
| + if (!pod.multiProfilesPolicyApplied)
|
| return pod;
|
| - }
|
| }
|
| return this.pods[0];
|
| },
|
|
|