5 gaia.chromeOSLogin = {};
7 gaia.chromeOSLogin.parent_page_url_ =
8 'chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/main.html';
10 gaia.chromeOSLogin.attemptLogin = function(email, password, attemptToken) {
12 'method': 'attemptLogin',
15 'attemptToken': attemptToken
17 window.parent.postMessage(msg, gaia.chromeOSLogin.parent_page_url_);
20 gaia.chromeOSLogin.clearOldAttempts = function() {
22 'method': 'clearOldAttempts'
24 window.parent.postMessage(msg, gaia.chromeOSLogin.parent_page_url_);
27 gaia.chromeOSLogin.onAttemptedLogin = function(emailFormElement,
30 var email = emailFormElement.value;
31 var passwd = passwordFormElement.value;
32 var attemptToken = new Date().getTime();
34 gaia.chromeOSLogin.attemptLogin(email, passwd, attemptToken);
36 if (continueUrlElement) {
37 var prevAttemptIndex = continueUrlElement.value.indexOf('?attemptToken');
38 if (prevAttemptIndex != -
1) {
39 continueUrlElement.value =
40 continueUrlElement.value.substr(
0, prevAttemptIndex);
42 continueUrlElement.value += '?attemptToken=' + attemptToken;
46 function submitAndGo() {
47 gaia.chromeOSLogin.onAttemptedLogin(document.getElementById(
"Email"),
48 document.getElementById(
"Passwd"),
49 document.getElementById(
"continue"));
53 function onAuthError() {
54 if (window.domAutomationController) {
55 window.domAutomationController.sendWithId(
4444, 'loginfail');
60 gaia.chromeOSLogin.clearOldAttempts();
64 <BODY onload='onLoad();'
>
65 Local Auth Server:
<BR>
66 <FORM action='/ServiceLoginAuth' method=POST onsubmit='submitAndGo()'
>
67 <INPUT TYPE=text
id=
"Email" name=
"Email">
68 <INPUT TYPE=text
id=
"Passwd" name=
"Passwd">
69 <INPUT TYPE=hidden
id=
"continue" name=
"continue"
70 value=
"chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/success.html">
71 <INPUT TYPE=Submit
id=
"signIn">