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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 get header() { | 43 get header() { |
44 return localStrings.getString('signinScreenTitle'); | 44 return localStrings.getString('signinScreenTitle'); |
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); | 53 console.log('Opening extension: ' + JSON.stringify(data)); |
zel
2011/08/05 00:01:49
please make sure we have no private info of any so
xiyuan
2011/08/05 01:04:12
Done. Changed to just output startUrl and email pr
| |
54 var frame = $('signin-frame'); | 54 var frame = $('signin-frame'); |
55 frame.addEventListener('load', function(e) { | 55 frame.addEventListener('load', function(e) { |
56 console.log('Frame loaded: ' + data); | 56 console.log('Frame loaded: ' + data.startUrl); |
57 }); | 57 }); |
58 frame.contentWindow.location.href = data.startUrl; | 58 frame.contentWindow.location.href = data.startUrl; |
59 this.extension_url_ = data.startUrl; | 59 this.extension_url_ = data.startUrl; |
60 // TODO(xiyuan): Pre-populate Gaia with data.email (if any). | 60 // TODO(xiyuan): Pre-populate Gaia with data.email (if any). |
61 }, | 61 }, |
62 | 62 |
63 /** | 63 /** |
64 * Checks if message comes from the loaded authentication extension. | 64 * Checks if message comes from the loaded authentication extension. |
65 * @param e {object} Payload of the received HTML5 message. | 65 * @param e {object} Payload of the received HTML5 message. |
66 * @type {bool} | 66 * @type {bool} |
(...skipping 11 matching lines...) Expand all Loading... | |
78 if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { | 78 if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { |
79 chrome.send('completeLogin', [msg.email, msg.password] ); | 79 chrome.send('completeLogin', [msg.email, msg.password] ); |
80 } | 80 } |
81 } | 81 } |
82 }; | 82 }; |
83 | 83 |
84 return { | 84 return { |
85 GaiaSigninScreen: GaiaSigninScreen | 85 GaiaSigninScreen: GaiaSigninScreen |
86 }; | 86 }; |
87 }); | 87 }); |
OLD | NEW |