2 <html i18n-values=
"dir:textdirection">
5 <link rel=
"stylesheet" href=
"dialog.css">
8 margin:
10px
10px
0 10px;
9 -webkit-user-select: none;
27 #password-label-cell {
29 -webkit-padding-end:
5px;
44 return document
.getElementById(o
);
47 function disableControls() {
48 $('username').disabled
= true;
49 $('password').disabled
= true;
50 $('login').disabled
= true;
51 $('cancel').disabled
= true;
54 function sendCredentialsAndClose() {
57 var result
= JSON
.stringify({
58 'username': $('username').value
,
59 'password': $('password').value
});
61 chrome
.send('DialogClose', [result
]);
66 chrome
.send('DialogClose');
69 function handleSubmit(e
) {
70 sendCredentialsAndClose();
74 function handleKeyDown(e
) {
75 if (e
.keyCode
== 27) { // Escape
81 function setAutofillCredentials(username
, password
) {
82 $('username').value
= username
;
83 $('password').value
= password
;
87 document
.addEventListener('keydown', handleKeyDown
);
88 $('explanation').textContent
= chrome
.getVariableValue('dialogArguments');
89 $('form').onsubmit
= handleSubmit
;
90 $('cancel').onclick
= cancel
;
92 chrome
.send('GetAutofill', ['']);
95 document
.addEventListener('DOMContentLoaded', load
);
98 <body i18n-values=
".style.fontFamily:fontfamily;.style.fontSize:fontsize">
99 <div id=
"explanation"></div>
103 <td id=
"username-label-cell">
104 <label for=
"username" i18n-content=
"username"></label>
107 <input id=
"username" type=
"text" autofocus
>
111 <td id=
"password-label-cell">
112 <label for=
"password" i18n-content=
"password"></label>
115 <input id=
"password" name=
"password" type=
"password">
120 <input id=
"cancel" type=
"reset" i18n-values=
"value:cancel">
121 <input id=
"login" type=
"submit" i18n-values=
"value:signin">