| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script> | 3 <script> |
| 4 var gaia = gaia || {}; | 4 var gaia = gaia || {}; |
| 5 gaia.chromeOSLogin = {}; | 5 gaia.chromeOSLogin = {}; |
| 6 | 6 |
| 7 gaia.chromeOSLogin.parent_webview_signin_url_ = 'chrome://chrome-signin'; | 7 gaia.chromeOSLogin.parent_webview_signin_url_ = 'chrome://chrome-signin'; |
| 8 gaia.chromeOSLogin.parent_webview_oob_url_ = 'chrome://oobe'; | 8 gaia.chromeOSLogin.parent_webview_oob_url_ = 'chrome://oobe'; |
| 9 gaia.chromeOSLogin.parent_webview_ = undefined; | 9 gaia.chromeOSLogin.parent_webview_ = undefined; |
| 10 gaia.chromeOSLogin.parent_webview_url_ = undefined; | 10 gaia.chromeOSLogin.parent_webview_url_ = undefined; |
| 11 | 11 |
| 12 gaia.chromeOSLogin.registerHtml5Listener = function() { | 12 gaia.chromeOSLogin.registerHtml5Listener = function() { |
| 13 var onMessage = function(e) { | 13 var onMessage = function(e) { |
| 14 if (e.origin == gaia.chromeOSLogin.parent_webview_signin_url_ || | 14 if (e.origin == gaia.chromeOSLogin.parent_webview_signin_url_ || |
| 15 e.origin == gaia.chromeOSLogin.parent_webview_oob_url_) { | 15 e.origin == gaia.chromeOSLogin.parent_webview_oob_url_) { |
| 16 gaia.chromeOSLogin.parent_webview_ = e.source; | 16 gaia.chromeOSLogin.parent_webview_ = e.source; |
| 17 gaia.chromeOSLogin.parent_webview_url_ = e.origin; | 17 gaia.chromeOSLogin.parent_webview_url_ = e.origin; |
| 18 | 18 |
| 19 // Repeat clearOldAttempts as soon as we got parent. | 19 // Repeat clearOldAttempts as soon as we got parent. |
| 20 gaia.chromeOSLogin.clearOldAttempts(); | 20 gaia.chromeOSLogin.clearOldAttempts(); |
| 21 } | 21 } |
| 22 }; | 22 }; |
| 23 window.addEventListener('message', onMessage); | 23 window.addEventListener('message', onMessage); |
| 24 window.addEventListener("popstate", function(e) { goBack(); }); | 24 window.addEventListener("popstate", function(e) { goBack(); }); |
| 25 window.postMessage({ |
| 26 type: 'gaia_saml_api', |
| 27 call: {method: 'initialize', requestedVersion: 1}}, '/'); |
| 25 } | 28 } |
| 26 | 29 |
| 27 gaia.chromeOSLogin.clearOldAttempts = function() { | 30 gaia.chromeOSLogin.clearOldAttempts = function() { |
| 28 var msg = { | 31 var msg = { |
| 29 'method': 'clearOldAttempts' | 32 'method': 'clearOldAttempts' |
| 30 }; | 33 }; |
| 31 gaia.chromeOSLogin.parent_webview_.postMessage(msg, | 34 gaia.chromeOSLogin.parent_webview_.postMessage(msg, |
| 32 gaia.chromeOSLogin.parent_webview_url_); | 35 gaia.chromeOSLogin.parent_webview_url_); |
| 33 }; | 36 }; |
| 34 | 37 |
| 35 gaia.chromeOSLogin.attemptLogin = function(email, password) { | 38 gaia.chromeOSLogin.attemptLogin = function(email, password) { |
| 36 var msg = { | 39 var msg = { |
| 37 'method': 'attemptLogin', | 40 'method': 'attemptLogin', |
| 38 'email': email, | 41 'email': email, |
| 39 'password': password, | |
| 40 }; | 42 }; |
| 41 gaia.chromeOSLogin.parent_webview_.postMessage(msg, | 43 gaia.chromeOSLogin.parent_webview_.postMessage(msg, |
| 42 gaia.chromeOSLogin.parent_webview_url_); | 44 gaia.chromeOSLogin.parent_webview_url_); |
| 45 |
| 46 // SAML credential passing api for password. |
| 47 window.postMessage( |
| 48 {type: 'gaia_saml_api', |
| 49 call: {method: 'add', |
| 50 token: 'token', |
| 51 user: email, |
| 52 passwordBytes: password, |
| 53 keyType: 'KEY_TYPE_PASSWORD_PLAIN'} |
| 54 }, '/'); |
| 43 }; | 55 }; |
| 44 | 56 |
| 45 gaia.chromeOSLogin.backButton = function(show) { | 57 gaia.chromeOSLogin.backButton = function(show) { |
| 46 var msg = { | 58 var msg = { |
| 47 'method': 'backButton', | 59 'method': 'backButton', |
| 48 'show': show, | 60 'show': show, |
| 49 }; | 61 }; |
| 50 gaia.chromeOSLogin.parent_webview_.postMessage(msg, | 62 gaia.chromeOSLogin.parent_webview_.postMessage(msg, |
| 51 gaia.chromeOSLogin.parent_webview_url_); | 63 gaia.chromeOSLogin.parent_webview_url_); |
| 52 }; | 64 }; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 Email | 126 Email |
| 115 <input id="identifier" name="identifier" type="email" spellcheck="false" aut
ocomplete="off" formnovalidate=""> | 127 <input id="identifier" name="identifier" type="email" spellcheck="false" aut
ocomplete="off" formnovalidate=""> |
| 116 </div> | 128 </div> |
| 117 <div id="page2" hidden> | 129 <div id="page2" hidden> |
| 118 Password | 130 Password |
| 119 <input id="password" name="password" type="password" spellcheck="false" auto
complete="off" formnovalidate=""> | 131 <input id="password" name="password" type="password" spellcheck="false" auto
complete="off" formnovalidate=""> |
| 120 </div><br> | 132 </div><br> |
| 121 <div id='nextButton' onclick='goNext();'>Next</div> | 133 <div id='nextButton' onclick='goNext();'>Next</div> |
| 122 </body> | 134 </body> |
| 123 </html> | 135 </html> |
| OLD | NEW |