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 function Authenticator() { | 5 function Authenticator() { |
6 } | 6 } |
7 | 7 |
8 Authenticator.getInstance = function() { | 8 Authenticator.getInstance = function() { |
9 if (!Authenticator.instance_) { | 9 if (!Authenticator.instance_) { |
10 Authenticator.instance_ = new Authenticator(); | 10 Authenticator.instance_ = new Authenticator(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 if (this.attemptToken_ == msg.attemptToken) { | 103 if (this.attemptToken_ == msg.attemptToken) { |
104 var msg = { | 104 var msg = { |
105 'method': 'completeLogin', | 105 'method': 'completeLogin', |
106 'email': this.email_, | 106 'email': this.email_, |
107 'password': this.password_ | 107 'password': this.password_ |
108 }; | 108 }; |
109 window.parent.postMessage(msg, this.PARENT_PAGE); | 109 window.parent.postMessage(msg, this.PARENT_PAGE); |
110 } else { | 110 } else { |
111 console.log('#### Authenticator.onMessage: unexpected attemptToken!?'); | 111 console.log('#### Authenticator.onMessage: unexpected attemptToken!?'); |
112 } | 112 } |
| 113 } else if (msg.method == 'confirmAuthentication' && |
| 114 this.isInternalMessage_(e)) { |
| 115 var msg = { |
| 116 'method': 'completeAuthentication', |
| 117 'email': msg.email, |
| 118 'authCode': msg.authCode |
| 119 }; |
| 120 window.parent.postMessage(msg, this.PARENT_PAGE); |
113 } else { | 121 } else { |
114 console.log('#### Authenticator.onMessage: unknown message + origin!?'); | 122 console.log('#### Authenticator.onMessage: unknown message + origin!?'); |
115 } | 123 } |
116 } | 124 } |
117 }; | 125 }; |
118 | 126 |
119 Authenticator.getInstance().initialize(); | 127 Authenticator.getInstance().initialize(); |
120 | 128 |
OLD | NEW |