| 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 if (this.inlineMode_) { |
| 192 $('gaia-frame').focus(); |
| 193 } |
| 191 }, | 194 }, |
| 192 | 195 |
| 193 onConfirmLogin_: function() { | 196 onConfirmLogin_: function() { |
| 194 if (!this.samlPageLoaded_) { | 197 if (!this.samlPageLoaded_) { |
| 195 this.completeLogin(this.email_, this.password_); | 198 this.completeLogin(this.email_, this.password_); |
| 196 return; | 199 return; |
| 197 } | 200 } |
| 198 | 201 |
| 199 this.samlSupportChannel_.sendWithCallback( | 202 this.samlSupportChannel_.sendWithCallback( |
| 200 {name: 'getScrapedPasswords'}, | 203 {name: 'getScrapedPasswords'}, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } else if (msg.method == 'navigate' && | 256 } else if (msg.method == 'navigate' && |
| 254 this.isParentMessage_(e)) { | 257 this.isParentMessage_(e)) { |
| 255 $('gaia-frame').src = msg.src; | 258 $('gaia-frame').src = msg.src; |
| 256 } else { | 259 } else { |
| 257 console.error('Authenticator.onMessage: unknown message + origin!?'); | 260 console.error('Authenticator.onMessage: unknown message + origin!?'); |
| 258 } | 261 } |
| 259 } | 262 } |
| 260 }; | 263 }; |
| 261 | 264 |
| 262 Authenticator.getInstance().initialize(); | 265 Authenticator.getInstance().initialize(); |
| OLD | NEW |