Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1481)

Unified Diff: chrome/browser/resources/http_auth.html

Issue 7709013: chromeos: Make WebUI auth dialog handle Enter and Escape. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more changes Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/http_auth.html
diff --git a/chrome/browser/resources/http_auth.html b/chrome/browser/resources/http_auth.html
index 53fb6999c184f00f1f28dea25af1d62f17883390..4a269329ea70b1769a7f64a09041e9b496804ed1 100644
--- a/chrome/browser/resources/http_auth.html
+++ b/chrome/browser/resources/http_auth.html
@@ -3,7 +3,33 @@
<head>
<style type="text/css">
body {
- margin: 0px;
+ margin: 10px 10px 0px 10px;
arv (Not doing code reviews) 2011/08/23 01:25:33 s/0px/0/
Daniel Erat 2011/08/23 21:45:09 Done.
+ -webkit-user-select: none;
+ }
+
+ form {
+ margin: 0;
+ }
+
+ #explanation {
+ cursor: default;
+ }
+
+ #fields {
+ padding: 10px 0;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+ #usernameLabelCell,
+ #passwordLabelCell {
+ text-align: right;
Daniel Erat 2011/08/23 00:48:04 This isn't RTL-friendly, but with the exception of
arv (Not doing code reviews) 2011/08/23 01:25:33 RTL text-align: end;
Daniel Erat 2011/08/23 21:45:09 Done.
+ padding-right: 5px;
arv (Not doing code reviews) 2011/08/23 01:25:33 -webkit-padding-end: 5px;
Daniel Erat 2011/08/23 21:45:09 Done.
+ }
+
+ #username,
+ #password {
+ width: 150px;
}
#buttons {
@@ -14,10 +40,6 @@
text-align: left;
arv (Not doing code reviews) 2011/08/23 01:25:33 with text-alugn: end this can be removed
Daniel Erat 2011/08/23 21:45:09 Done.
}
- #username,
- #password {
- width: 220px;
- }
</style>
<script type="text/javascript">
arv (Not doing code reviews) 2011/08/23 01:25:33 remove type
Daniel Erat 2011/08/23 21:45:09 Done.
function $(o) {
@@ -41,23 +63,33 @@
chrome.send('DialogClose', [result]);
}
+ function cancel() {
+ disableControls();
+ chrome.send('DialogClose');
+ }
+
+ function handleSubmit(e) {
+ sendCredentialsAndClose();
+ e.preventDefault();
+ }
+
+ function handleKeyDown(e) {
+ if (e.keyCode == 27) { // Escape
+ cancel();
+ e.preventDefault();
+ }
+ }
+
function setAutofillCredentials(username, password) {
$('username').value = username;
$('password').value = password;
}
function load() {
+ document.addEventListener('keydown', handleKeyDown);
$('explanation').textContent = chrome.dialogArguments;
-
- $('cancel').onclick = function() {
- disableControls();
- chrome.send('DialogClose', ['']);
- };
-
- $('login').onclick = function() {
- sendCredentialsAndClose();
- };
-
+ $('form').onsubmit = handleSubmit;
+ $('cancel').onclick = cancel;
$('username').focus();
chrome.send('GetAutofill', ['']);
@@ -68,23 +100,29 @@
</head>
<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
<div id="explanation"></div>
- <table>
- <tr>
- <td i18n-content="username"></td>
- <td>
- <input id="username" type="text">
- </td>
- </tr>
- <tr>
- <td i18n-content="password"></td>
- <td>
- <input id="password" name="password" type="password">
- </td>
- </tr>
- </table>
- <div id="buttons">
- <input id="cancel" type="button" i18n-values="value:cancel">
- <input id="login" type="button" i18n-values="value:signin">
- </div>
+ <form id="form">
+ <table id="fields">
+ <tr>
+ <td id="usernameLabelCell">
arv (Not doing code reviews) 2011/08/23 01:25:33 username-label-cell https://sites.google.com/a/ch
Daniel Erat 2011/08/23 21:45:09 Done.
+ <label for="username" i18n-content="username"></label>
+ </td>
+ <td>
+ <input id="username" type="text">
+ </td>
+ </tr>
+ <tr>
+ <td id="passwordLabelCell">
+ <label for="password" i18n-content="password"></label>
+ </td>
+ <td>
+ <input id="password" name="password" type="password">
+ </td>
+ </tr>
+ </table>
+ <div id="buttons">
+ <input id="cancel" type="button" i18n-values="value:cancel">
+ <input id="login" type="submit" i18n-values="value:signin">
+ </div>
+ </form>
</body>
</html>
« no previous file with comments | « no previous file | chrome/browser/ui/login/login_prompt_ui.cc » ('j') | chrome/browser/ui/login/login_prompt_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698