| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <include src="post_message_channel.js"> | 5 <include src="post_message_channel.js"> |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @fileoverview Saml support for webview based auth. | 8 * @fileoverview Saml support for webview based auth. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 424 |
| 425 if (call.method == 'add') { | 425 if (call.method == 'add') { |
| 426 if (API_KEY_TYPES.indexOf(call.keyType) == -1) { | 426 if (API_KEY_TYPES.indexOf(call.keyType) == -1) { |
| 427 console.error('SamlHandler.onAPICall_: unsupported key type'); | 427 console.error('SamlHandler.onAPICall_: unsupported key type'); |
| 428 return; | 428 return; |
| 429 } | 429 } |
| 430 // Not setting |email_| and |gaiaId_| because this API call will | 430 // Not setting |email_| and |gaiaId_| because this API call will |
| 431 // eventually be followed by onCompleteLogin_() which does set it. | 431 // eventually be followed by onCompleteLogin_() which does set it. |
| 432 this.apiToken_ = call.token; | 432 this.apiToken_ = call.token; |
| 433 this.apiPasswordBytes_ = call.passwordBytes; | 433 this.apiPasswordBytes_ = call.passwordBytes; |
| 434 |
| 435 this.dispatchEvent(new CustomEvent('apiPasswordAdded')); |
| 434 } else if (call.method == 'confirm') { | 436 } else if (call.method == 'confirm') { |
| 435 if (call.token != this.apiToken_) | 437 if (call.token != this.apiToken_) |
| 436 console.error('SamlHandler.onAPICall_: token mismatch'); | 438 console.error('SamlHandler.onAPICall_: token mismatch'); |
| 437 } else { | 439 } else { |
| 438 console.error('SamlHandler.onAPICall_: unknown message'); | 440 console.error('SamlHandler.onAPICall_: unknown message'); |
| 439 } | 441 } |
| 440 }, | 442 }, |
| 441 | 443 |
| 442 onUpdatePassword_: function(channel, msg) { | 444 onUpdatePassword_: function(channel, msg) { |
| 443 if (this.isSamlPage_) | 445 if (this.isSamlPage_) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 464 | 466 |
| 465 onGetSAMLFlag_: function(channel, msg) { | 467 onGetSAMLFlag_: function(channel, msg) { |
| 466 return this.isSamlPage_; | 468 return this.isSamlPage_; |
| 467 }, | 469 }, |
| 468 }; | 470 }; |
| 469 | 471 |
| 470 return { | 472 return { |
| 471 SamlHandler: SamlHandler | 473 SamlHandler: SamlHandler |
| 472 }; | 474 }; |
| 473 }); | 475 }); |
| OLD | NEW |