OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * Authenticator class wraps the communications between Gaia and its host. | 6 * Authenticator class wraps the communications between Gaia and its host. |
7 */ | 7 */ |
8 function Authenticator() { | 8 function Authenticator() { |
9 } | 9 } |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 'method': 'authPageLoaded', | 181 'method': 'authPageLoaded', |
182 'isSAML': this.samlPageLoaded_ | 182 'isSAML': this.samlPageLoaded_ |
183 }, this.parentPage_); | 183 }, this.parentPage_); |
184 }, | 184 }, |
185 | 185 |
186 onLoginUILoaded: function() { | 186 onLoginUILoaded: function() { |
187 var msg = { | 187 var msg = { |
188 'method': 'loginUILoaded' | 188 'method': 'loginUILoaded' |
189 }; | 189 }; |
190 window.parent.postMessage(msg, this.parentPage_); | 190 window.parent.postMessage(msg, this.parentPage_); |
191 $('gaia-frame').focus(); | |
xiyuan
2013/12/02 19:26:37
This might interfere with chromeos login screen's
guohui
2013/12/02 19:32:00
Done.
| |
191 }, | 192 }, |
192 | 193 |
193 onConfirmLogin_: function() { | 194 onConfirmLogin_: function() { |
194 if (!this.samlPageLoaded_) { | 195 if (!this.samlPageLoaded_) { |
195 this.completeLogin(this.email_, this.password_); | 196 this.completeLogin(this.email_, this.password_); |
196 return; | 197 return; |
197 } | 198 } |
198 | 199 |
199 this.samlSupportChannel_.sendWithCallback( | 200 this.samlSupportChannel_.sendWithCallback( |
200 {name: 'getScrapedPasswords'}, | 201 {name: 'getScrapedPasswords'}, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 } else if (msg.method == 'navigate' && | 254 } else if (msg.method == 'navigate' && |
254 this.isParentMessage_(e)) { | 255 this.isParentMessage_(e)) { |
255 $('gaia-frame').src = msg.src; | 256 $('gaia-frame').src = msg.src; |
256 } else { | 257 } else { |
257 console.error('Authenticator.onMessage: unknown message + origin!?'); | 258 console.error('Authenticator.onMessage: unknown message + origin!?'); |
258 } | 259 } |
259 } | 260 } |
260 }; | 261 }; |
261 | 262 |
262 Authenticator.getInstance().initialize(); | 263 Authenticator.getInstance().initialize(); |
OLD | NEW |