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: ' + data.startUrl + |
| 54 ', opt_email=' + data.email); |
54 var frame = $('signin-frame'); | 55 var frame = $('signin-frame'); |
55 frame.addEventListener('load', function(e) { | 56 frame.addEventListener('load', function(e) { |
56 console.log('Frame loaded: ' + data); | 57 console.log('Frame loaded: ' + data.startUrl); |
57 }); | 58 }); |
58 frame.contentWindow.location.href = data.startUrl; | 59 frame.contentWindow.location.href = data.startUrl; |
59 this.extension_url_ = data.startUrl; | 60 this.extension_url_ = data.startUrl; |
60 // TODO(xiyuan): Pre-populate Gaia with data.email (if any). | 61 // TODO(xiyuan): Pre-populate Gaia with data.email (if any). |
61 }, | 62 }, |
62 | 63 |
63 /** | 64 /** |
64 * Checks if message comes from the loaded authentication extension. | 65 * Checks if message comes from the loaded authentication extension. |
65 * @param e {object} Payload of the received HTML5 message. | 66 * @param e {object} Payload of the received HTML5 message. |
66 * @type {bool} | 67 * @type {bool} |
(...skipping 11 matching lines...) Expand all Loading... |
78 if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { | 79 if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { |
79 chrome.send('completeLogin', [msg.email, msg.password] ); | 80 chrome.send('completeLogin', [msg.email, msg.password] ); |
80 } | 81 } |
81 } | 82 } |
82 }; | 83 }; |
83 | 84 |
84 return { | 85 return { |
85 GaiaSigninScreen: GaiaSigninScreen | 86 GaiaSigninScreen: GaiaSigninScreen |
86 }; | 87 }; |
87 }); | 88 }); |
OLD | NEW |