Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/user_pod_row.js |
| diff --git a/chrome/browser/resources/chromeos/login/user_pod_row.js b/chrome/browser/resources/chromeos/login/user_pod_row.js |
| index 111d7c2641f20b63d6636fdb13be4fe500a28918..c878985b7915dffa2d4f878a6d1b663bce72b20a 100644 |
| --- a/chrome/browser/resources/chromeos/login/user_pod_row.js |
| +++ b/chrome/browser/resources/chromeos/login/user_pod_row.js |
| @@ -196,6 +196,14 @@ cr.define('login', function() { |
| }, |
| /** |
| + * Gets managed badge image. |
| + * @type {!HTMLImageElement} |
| + */ |
| + get managedBadgeElement() { |
| + return this.capslockHintElement.previousElementSibling; |
| + }, |
| + |
| + /** |
| * Gets Caps Lock hint image. |
| * @type {!HTMLImageElement} |
| */ |
| @@ -239,6 +247,14 @@ cr.define('login', function() { |
| 'passwordFieldAccessibleName', |
| this.user_.emailAddress)); |
| this.signinButtonElement.hidden = !needSignin; |
| + |
| + if (this.user.publicAccount) { |
|
bartfab (slow)
2012/11/28 15:11:38
As described below, I think a separate |this.user.
xiyuan
2012/12/01 00:24:19
Created a new PublicAccountUserPod that derives fr
|
| + this.classList.remove('need-password'); |
| + this.managedBadgeElement.hidden = false; |
| + } else { |
| + this.classList.add('need-password'); |
| + this.managedBadgeElement.hidden = true; |
| + } |
| }, |
| /** |
| @@ -259,9 +275,11 @@ cr.define('login', function() { |
| */ |
| get needGaiaSignin() { |
| // Gaia signin is performed if the user has an invalid oauth token and is |
| - // not currently signed in (i.e. not the lock screen). |
| + // not currently signed in (i.e. not the lock screen) and is not a public |
|
bartfab (slow)
2012/11/28 15:11:38
Nit: "public account user" (for consistency throug
xiyuan
2012/12/01 00:24:19
This change is reverted in new patch.
|
| + // user. |
| return this.user.oauthTokenStatus != OAuthTokenStatus.VALID && |
| - !this.user.signedIn; |
| + !this.user.signedIn && |
| + !this.user.publicAccount; |
|
bartfab (slow)
2012/11/28 15:11:38
This is a bit akin to user agent sniffing: What yo
xiyuan
2012/12/01 00:24:19
Reverted the change here. In new PublicAccountUser
|
| }, |
| /** |
| @@ -326,7 +344,16 @@ cr.define('login', function() { |
| * @return {boolean} True if activated successfully. |
| */ |
| activate: function() { |
| - if (!this.signinButtonElement.hidden) { |
| + if (this.user.publicAccount) { |
| + Oobe.showScreen({ |
|
bartfab (slow)
2012/11/28 15:11:38
I have not run the code but I would imagine that t
Nikita (slow)
2012/11/28 18:57:34
Yes, that would be the right thing to do but that
xiyuan
2012/12/01 00:24:19
Refactored the CL to expand user pod instead of us
|
| + id: SCREEN_PUBLIC_ACCOUNT_SIGNIN, |
| + data: { |
| + name: this.user_.displayName, |
| + email: this.user_.username, |
| + imageUrl: this.imageElement.src |
|
bartfab (slow)
2012/11/28 15:11:38
The avatar is loaded asynchronously. It may happen
Ivan Korotkov
2012/11/28 21:50:39
'src' should still be accessible while it loads, r
bartfab (slow)
2012/11/29 14:32:28
Sure, the |src| is accessible - but what does it p
Ivan Korotkov
2012/11/29 17:23:20
Right, I missed that.
xiyuan
2012/12/01 00:24:19
New patch expand user pod in-place and will no lon
|
| + } |
| + }); |
| + } else if (!this.signinButtonElement.hidden) { |
| // Switch to Gaia signin. |
| this.showSigninUI(); |
| } else if (!this.passwordElement.value) { |
| @@ -387,7 +414,11 @@ cr.define('login', function() { |
| handleMouseDown_: function(e) { |
| if (this.parentNode.disabled) |
| return; |
| - if (!this.signinButtonElement.hidden) { |
| + if (this.user.publicAccount) { |
| + this.parentNode.activatedPod = this; |
| + // Prevent default so that we don't trigger 'focus' event. |
| + e.preventDefault(); |
| + } else if (!this.signinButtonElement.hidden) { |
| this.showSigninUI(); |
|
bartfab (slow)
2012/11/28 15:11:38
Any idea why this line uses |this.showSigninUI()|
Ivan Korotkov
2012/11/28 21:50:39
Because if signingButton.hidden == false, that mea
bartfab (slow)
2012/11/29 14:32:28
Thanks for clarifying.
|
| // Prevent default so that we don't trigger 'focus' event. |
| e.preventDefault(); |