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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 'domain': extractDomain(msg.url) | 224 'domain': extractDomain(msg.url) |
225 }, this.parentPage_); | 225 }, this.parentPage_); |
226 }, | 226 }, |
227 | 227 |
228 onLoginUILoaded: function() { | 228 onLoginUILoaded: function() { |
229 var msg = { | 229 var msg = { |
230 'method': 'loginUILoaded' | 230 'method': 'loginUILoaded' |
231 }; | 231 }; |
232 window.parent.postMessage(msg, this.parentPage_); | 232 window.parent.postMessage(msg, this.parentPage_); |
233 if (this.inlineMode_) { | 233 if (this.inlineMode_) { |
234 $('gaia-frame').focus(); | 234 var gaiaFrame = $('gaia-frame'); |
235 gaiaFrame.focus(); | |
236 gaiaFrame.onblur = function() { | |
237 gaiaFrame.focus(); | |
xiyuan
2014/01/07 21:49:48
Would this has side effect? e.g. what happens user
guohui
2014/01/07 22:15:02
the only side effect i have observed is that upon
| |
238 }; | |
235 } | 239 } |
236 this.loaded_ = true; | 240 this.loaded_ = true; |
237 }, | 241 }, |
238 | 242 |
239 onConfirmLogin_: function() { | 243 onConfirmLogin_: function() { |
240 if (!this.isSAMLFlow_) { | 244 if (!this.isSAMLFlow_) { |
241 this.completeLogin(this.email_, this.password_); | 245 this.completeLogin(this.email_, this.password_); |
242 return; | 246 return; |
243 } | 247 } |
244 | 248 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 } else if (msg.method == 'redirectToSignin' && | 308 } else if (msg.method == 'redirectToSignin' && |
305 this.isParentMessage_(e)) { | 309 this.isParentMessage_(e)) { |
306 $('gaia-frame').src = this.constructInitialFrameUrl_(); | 310 $('gaia-frame').src = this.constructInitialFrameUrl_(); |
307 } else { | 311 } else { |
308 console.error('Authenticator.onMessage: unknown message + origin!?'); | 312 console.error('Authenticator.onMessage: unknown message + origin!?'); |
309 } | 313 } |
310 } | 314 } |
311 }; | 315 }; |
312 | 316 |
313 Authenticator.getInstance().initialize(); | 317 Authenticator.getInstance().initialize(); |
OLD | NEW |