OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Variable to track if a captcha challenge was issued. If this gets set to | 5 // Variable to track if a captcha challenge was issued. If this gets set to |
6 // true, it stays that way until we are told about successful login from | 6 // true, it stays that way until we are told about successful login from |
7 // the browser. This means subsequent errors (like invalid password) are | 7 // the browser. This means subsequent errors (like invalid password) are |
8 // rendered in the captcha state, which is basically identical except we | 8 // rendered in the captcha state, which is basically identical except we |
9 // don't show the top error blurb "Error Signing in" or the "Create | 9 // don't show the top error blurb "Error Signing in" or the "Create |
10 // account" link. | 10 // account" link. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 loginForm.onsubmit = function() { | 148 loginForm.onsubmit = function() { |
149 sendCredentialsAndClose(); | 149 sendCredentialsAndClose(); |
150 return false; | 150 return false; |
151 }; | 151 }; |
152 | 152 |
153 var gaiaCancel = document.getElementById('gaia-cancel'); | 153 var gaiaCancel = document.getElementById('gaia-cancel'); |
154 gaiaCancel.onclick = function() { | 154 gaiaCancel.onclick = function() { |
155 CloseDialog(); | 155 CloseDialog(); |
156 }; | 156 }; |
157 | 157 |
158 var args = JSON.parse(chrome.dialogArguments); | 158 var args = JSON.parse(chrome.getVariableValue("dialogArguments")); |
159 showGaiaLogin(args); | 159 showGaiaLogin(args); |
160 } | 160 } |
161 | 161 |
162 function sendCredentialsAndClose() { | 162 function sendCredentialsAndClose() { |
163 if (!setErrorVisibility()) | 163 if (!setErrorVisibility()) |
164 return false; | 164 return false; |
165 | 165 |
166 document.getElementById('email').disabled = true; | 166 document.getElementById('email').disabled = true; |
167 document.getElementById('passwd').disabled = true; | 167 document.getElementById('passwd').disabled = true; |
168 document.getElementById('captcha-value').disabled = true; | 168 document.getElementById('captcha-value').disabled = true; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 function onPreLogin() { | 241 function onPreLogin() { |
242 if (window['onlogin'] != null) { | 242 if (window['onlogin'] != null) { |
243 return onlogin(); | 243 return onlogin(); |
244 } else { | 244 } else { |
245 return true; | 245 return true; |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 document.addEventListener('DOMContentLoaded', load); | 249 document.addEventListener('DOMContentLoaded', load); |
OLD | NEW |