Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/screen_public_account_signin.js |
| diff --git a/chrome/browser/resources/chromeos/login/screen_public_account_signin.js b/chrome/browser/resources/chromeos/login/screen_public_account_signin.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8a8089f1a7724428d4caa856f733f9ae97ff21f1 |
| --- /dev/null |
| +++ b/chrome/browser/resources/chromeos/login/screen_public_account_signin.js |
| @@ -0,0 +1,42 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +cr.define('login', function() { |
| + /** |
| + * Creates a new public account sign in screen. |
|
Nikita (slow)
2012/11/28 18:57:34
nit: at sign in screen
bartfab (slow)
2012/11/29 14:32:28
How does this class "create a new public account a
Nikita (slow)
2012/11/29 15:21:47
Right.
|
| + * @constructor |
| + * @extends {HTMLDivElement} |
| + */ |
| + var PublicAccountSigninScreen = cr.ui.define('div'); |
| + |
| + PublicAccountSigninScreen.register = function() { |
| + var screen = $('public-account-signin'); |
| + PublicAccountSigninScreen.decorate(screen); |
| + Oobe.getInstance().registerScreen(screen); |
| + }; |
| + |
| + PublicAccountSigninScreen.prototype = { |
| + __proto__: HTMLDivElement.prototype, |
| + |
| + email_: undefined, |
|
bartfab (slow)
2012/11/28 15:11:38
Is this needed? If you try to access |this.email_|
Ivan Korotkov
2012/11/28 21:50:39
This is what roughly corresponds to a static membe
bartfab (slow)
2012/11/29 14:32:28
Well, it's only a static default. If you set this.
|
| + |
| + /** @override */ |
| + decorate: function() { |
| + $('public-account-enter-button').addEventListener('click', (function(e) { |
| + if (this.email_) |
| + chrome.send('launchPublicAccount', [this.email_]); |
| + }).bind(this)); |
| + }, |
| + |
| + onBeforeShow: function(data) { |
| + this.email_ = data.email; |
| + $('public-account-name').textContent = data.name; |
| + $('public-account-avartar').src = data.imageUrl; |
|
Ivan Korotkov
2012/11/28 21:50:39
avatar
|
| + } |
| + }; |
| + |
| + return { |
| + PublicAccountSigninScreen: PublicAccountSigninScreen |
| + }; |
| +}); |