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 // TODO(guohui): temporary workaround until webview team fixes the focus |
| 235 // on their side. |
| 236 var gaiaFrame = $('gaia-frame'); |
| 237 gaiaFrame.focus(); |
| 238 gaiaFrame.onblur = function() { |
| 239 gaiaFrame.focus(); |
| 240 }; |
235 } | 241 } |
236 this.loaded_ = true; | 242 this.loaded_ = true; |
237 }, | 243 }, |
238 | 244 |
239 onConfirmLogin_: function() { | 245 onConfirmLogin_: function() { |
240 if (!this.isSAMLFlow_) { | 246 if (!this.isSAMLFlow_) { |
241 this.completeLogin(this.email_, this.password_); | 247 this.completeLogin(this.email_, this.password_); |
242 return; | 248 return; |
243 } | 249 } |
244 | 250 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 } else if (msg.method == 'redirectToSignin' && | 310 } else if (msg.method == 'redirectToSignin' && |
305 this.isParentMessage_(e)) { | 311 this.isParentMessage_(e)) { |
306 $('gaia-frame').src = this.constructInitialFrameUrl_(); | 312 $('gaia-frame').src = this.constructInitialFrameUrl_(); |
307 } else { | 313 } else { |
308 console.error('Authenticator.onMessage: unknown message + origin!?'); | 314 console.error('Authenticator.onMessage: unknown message + origin!?'); |
309 } | 315 } |
310 } | 316 } |
311 }; | 317 }; |
312 | 318 |
313 Authenticator.getInstance().initialize(); | 319 Authenticator.getInstance().initialize(); |
OLD | NEW |