| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 */ | 200 */ |
| 201 completeLogin_: function(opt_extraMsg) { | 201 completeLogin_: function(opt_extraMsg) { |
| 202 var msg = { | 202 var msg = { |
| 203 'method': 'completeLogin', | 203 'method': 'completeLogin', |
| 204 'email': (opt_extraMsg && opt_extraMsg.email) || this.email_, | 204 'email': (opt_extraMsg && opt_extraMsg.email) || this.email_, |
| 205 'password': (opt_extraMsg && opt_extraMsg.password) || | 205 'password': (opt_extraMsg && opt_extraMsg.password) || |
| 206 this.passwordBytes_, | 206 this.passwordBytes_, |
| 207 'usingSAML': this.isSAMLFlow_, | 207 'usingSAML': this.isSAMLFlow_, |
| 208 'chooseWhatToSync': this.chooseWhatToSync_ || false, | 208 'chooseWhatToSync': this.chooseWhatToSync_ || false, |
| 209 'skipForNow': opt_extraMsg && opt_extraMsg.skipForNow, | 209 'skipForNow': opt_extraMsg && opt_extraMsg.skipForNow, |
| 210 'sessionIndex': opt_extraMsg && opt_extraMsg.sessionIndex | 210 'sessionIndex': opt_extraMsg && opt_extraMsg.sessionIndex, |
| 211 'confirmUntrustedSignin': opt_extraMsg && |
| 212 opt_extraMsg.confirmUntrustedSignin |
| 211 }; | 213 }; |
| 212 window.parent.postMessage(msg, this.parentPage_); | 214 window.parent.postMessage(msg, this.parentPage_); |
| 213 if (this.isSAMLEnabled_) | 215 if (this.isSAMLEnabled_) |
| 214 this.supportChannel_.send({name: 'resetAuth'}); | 216 this.supportChannel_.send({name: 'resetAuth'}); |
| 215 }, | 217 }, |
| 216 | 218 |
| 217 /** | 219 /** |
| 218 * Invoked when 'enableSAML' event is received to initialize SAML support on | 220 * Invoked when 'enableSAML' event is received to initialize SAML support on |
| 219 * Chrome OS, or when initDesktopChannel_ is called on desktop. | 221 * Chrome OS, or when initDesktopChannel_ is called on desktop. |
| 220 */ | 222 */ |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 } else if (msg.method == 'redirectToSignin' && | 429 } else if (msg.method == 'redirectToSignin' && |
| 428 this.isParentMessage_(e)) { | 430 this.isParentMessage_(e)) { |
| 429 $('gaia-frame').src = this.constructInitialFrameUrl_(); | 431 $('gaia-frame').src = this.constructInitialFrameUrl_(); |
| 430 } else { | 432 } else { |
| 431 console.error('Authenticator.onMessage: unknown message + origin!?'); | 433 console.error('Authenticator.onMessage: unknown message + origin!?'); |
| 432 } | 434 } |
| 433 } | 435 } |
| 434 }; | 436 }; |
| 435 | 437 |
| 436 Authenticator.getInstance().initialize(); | 438 Authenticator.getInstance().initialize(); |
| OLD | NEW |