1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="login_ui.css" > 5 </head> 6 7 <body> 8 <div id="sign-in-div"> 9 <div id="sign-in-body"> 10 <div id="title-text"> 11 Sign in with your Google Account 12 </div> 13 <div> 14 <label> 15 <input type="text" id="user-text" name="user"> 16 Username 17 </label> 18 </div> 19 <div> 20 <label> 21 <input type="password" id="pass-text" name="pass"> 22 Password 23 </label> 24 </div> 25 <button type="button" id="login-button" onclick="callLogin();"> 26 Sign In 27 </button> 28 <a id="login-incognito" onclick="callLoginIncognito();"> 29 Browse without signing in 30 </a> 31 <a id="shutdown-system" onclick="callShutdownSystem();"> 32 Shutdown System 33 </a> 34 </div> 35 </div> 36 </body> 37 38 <script> 39 function callLogin() { 40 var user = document.getElementById('user-text').value; 41 var pass = document.getElementById('pass-text').value; 42 disableScreen(); 43 chrome.send('AuthenticateUser', [user, pass]); 44 } 45 46 function disableScreen() { 47 setDisabled(true); 48 } 49 50 function enableScreen() { 51 setDisabled(false); 52 } 53 54 function clearPassword() { 55 document.getElementById('pass-text').value = ''; 56 } 57 58 function resetPrompt() { 59 clearPassword(); 60 enableScreen(); 61 } 62 63 function setDisabled(on) { 64 document.getElementById('login-button').disabled = on; 65 document.getElementById('login-incognito').disabled = on; 66 document.getElementById('shutdown-system').disabled = on; 67 document.getElementById('user-text').disabled = on; 68 document.getElementById('pass-text').disabled = on; 69 } 70 71 function callLoginIncognito() { 72 disableScreen(); 73 chrome.send('LaunchIncognito', []); 74 } 75 76 function callShutdownSystem() { 77 disableScreen(); 78 chrome.send('ShutdownSystem', []); 79 } 80 81 </script> 82 </html> 83