Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / resources / tab_modal_confirm_dialog.html
blob7debfc79397bb7b21db93ffc82520596044d5caa
1 <!DOCTYPE html>
2 <html i18n-values="dir:textdirection">
3 <head>
4 <meta charset="utf-8">
5 <link rel="stylesheet" href="dialog.css">
6 <style>
7 body {
8 -webkit-user-select: none;
9 margin: 10px 10px 0 10px;
12 form {
13 margin: 0;
16 #explanation {
17 cursor: default;
20 #buttons {
21 padding: 10px 0;
22 text-align: end;
25 </style>
26 <script src="chrome://resources/js/i18n_template.js"></script>
27 <script>
28 function $(o) {
29 return document.getElementById(o);
32 function disableControls() {
33 $('cancel').disabled = true;
34 $('accept').disabled = true;
37 function cancel() {
38 disableControls();
39 chrome.send('DialogClose', [JSON.stringify(false)]);
42 function handleSubmit(e) {
43 disableControls();
44 e.preventDefault();
45 chrome.send('DialogClose', [JSON.stringify(true)]);
48 function handleKeyDown(e) {
49 if (e.keyCode == 27) { // Escape
50 e.preventDefault();
51 cancel();
55 function load() {
56 i18nTemplate.process(document, JSON.parse(
57 chrome.getVariableValue('dialogArguments')));
58 document.addEventListener('keydown', handleKeyDown);
59 $('form').onsubmit = handleSubmit;
60 $('cancel').onclick = cancel;
61 $('cancel').focus();
64 document.addEventListener('DOMContentLoaded', load);
65 </script>
66 </head>
67 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
68 <div id="explanation" i18n-content="message"></div>
69 <form id="form">
70 <div id="buttons">
71 <input id="cancel" type="reset" i18n-values="value:cancel" autofocus>
72 <input id="accept" type="submit" i18n-values="value:accept">
73 </div>
74 </form>
75 </body>
76 </html>