OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Oobe signin screen implementation. | 6 * @fileoverview Oobe signin screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('login', function() { | 9 cr.define('login', function() { |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 }, | 45 }, |
46 | 46 |
47 /** | 47 /** |
48 * Event handler that is invoked just before the frame is shown. | 48 * Event handler that is invoked just before the frame is shown. |
49 * @param data {string} Screen init payload. Url of auth extension start | 49 * @param data {string} Screen init payload. Url of auth extension start |
50 * page. | 50 * page. |
51 */ | 51 */ |
52 onBeforeShow: function(data) { | 52 onBeforeShow: function(data) { |
53 console.log('Opening extension: ' + data.startUrl + | 53 console.log('Opening extension: ' + data.startUrl + |
54 ', opt_email=' + data.email); | 54 ', opt_email=' + data.email); |
55 console.log(data); | |
xiyuan
2011/08/10 20:52:53
remove this debug code.
achuithb
2011/08/10 22:27:43
Done.
| |
55 var frame = $('signin-frame'); | 56 var frame = $('signin-frame'); |
56 frame.addEventListener('load', function(e) { | 57 frame.addEventListener('load', function(e) { |
57 console.log('Frame loaded: ' + data.startUrl); | 58 console.log('Frame loaded: ' + data.startUrl); |
58 }); | 59 }); |
59 frame.contentWindow.location.href = data.startUrl; | 60 frame.contentWindow.location.href = data.startUrl; |
60 this.extension_url_ = data.startUrl; | 61 this.extension_url_ = data.startUrl; |
61 // TODO(xiyuan): Pre-populate Gaia with data.email (if any). | 62 // TODO(xiyuan): Pre-populate Gaia with data.email (if any). |
63 | |
64 $('createAccount').style.display = data.createAccount ? '' : 'none'; | |
65 $('guestSignin').style.display = data.guestSignin ? '' : 'none'; | |
xiyuan
2011/08/10 20:52:53
$('createAccount').hidden = !data.createAccount;
$
achuithb
2011/08/10 22:27:43
Done.
| |
62 }, | 66 }, |
63 | 67 |
64 /** | 68 /** |
65 * Checks if message comes from the loaded authentication extension. | 69 * Checks if message comes from the loaded authentication extension. |
66 * @param e {object} Payload of the received HTML5 message. | 70 * @param e {object} Payload of the received HTML5 message. |
67 * @type {bool} | 71 * @type {bool} |
68 */ | 72 */ |
69 isAuthExtMessage_: function(e) { | 73 isAuthExtMessage_: function(e) { |
70 return this.extension_url_ != null && | 74 return this.extension_url_ != null && |
71 this.extension_url_.indexOf(e.origin) == 0 && | 75 this.extension_url_.indexOf(e.origin) == 0 && |
(...skipping 18 matching lines...) Expand all Loading... | |
90 reset: function(takeFocus) { | 94 reset: function(takeFocus) { |
91 // Reload and show the sign-in UI. | 95 // Reload and show the sign-in UI. |
92 Oobe.showSigninUI(); | 96 Oobe.showSigninUI(); |
93 } | 97 } |
94 }; | 98 }; |
95 | 99 |
96 return { | 100 return { |
97 GaiaSigninScreen: GaiaSigninScreen | 101 GaiaSigninScreen: GaiaSigninScreen |
98 }; | 102 }; |
99 }); | 103 }); |
OLD | NEW |