OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html i18n-values="dir:textdirection"> | 2 <html i18n-values="dir:textdirection"> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <title i18n-content="title"></title> | 5 <title i18n-content="title"></title> |
6 <style type="text/css"> | 6 <style type="text/css"> |
7 | 7 |
8 html { | 8 html { |
9 background-color: rgb(92, 0, 0); | 9 background-color: rgb(92, 0, 0); |
10 background-image: url(roadblock_background.png); | 10 background-image: url(roadblock_background.png); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 font-weight: bold; | 71 font-weight: bold; |
72 line-height: 140%; | 72 line-height: 140%; |
73 margin: 0 77px 6pt; | 73 margin: 0 77px 6pt; |
74 } | 74 } |
75 | 75 |
76 .twisty { | 76 .twisty { |
77 display: inline; | 77 display: inline; |
78 } | 78 } |
79 </style> | 79 </style> |
80 <script src="../../../../ui/webui/resources/js/assert.js"></script> | 80 <script src="../../../../ui/webui/resources/js/assert.js"></script> |
81 <script> | 81 <script src="ssl_errors_common.js"></script> |
82 // Should match SSLBlockingPageCommands in ssl_blocking_page.cc. | 82 <script src="roadblock.js"></script> |
83 var CMD_DONT_PROCEED = 0; | |
84 var CMD_PROCEED = 1; | |
85 var CMD_FOCUS = 2; | |
86 var CMD_MORE = 3; | |
87 | |
88 var showedMore = false; | |
89 var keyPressState = 0; | |
90 var gainFocus = false; | |
91 var setupExperiment = false; | |
92 | |
93 function $(o) { | |
94 return document.getElementById(o); | |
95 } | |
96 | |
97 function sendCommand(cmd) { | |
98 window.domAutomationController.setAutomationId(1); | |
99 window.domAutomationController.send(cmd); | |
100 } | |
101 | |
102 function toggleMoreInfo(collapse) { | |
103 $('more-info-long').hidden = collapse; | |
104 $('more-info-short').hidden = !collapse; | |
105 if (!collapse && !showedMore) { | |
106 sendCommand(CMD_MORE); | |
107 showedMore = true; | |
108 } | |
109 } | |
110 | |
111 // This allows errors to be skippped by typing "proceed" into the page. | |
112 function keyPressHandler(e) { | |
113 var sequence = 'proceed'; | |
114 if (sequence.charCodeAt(keyPressState) == e.keyCode) { | |
115 keyPressState++; | |
116 if (keyPressState == sequence.length) { | |
117 sendCommand(CMD_PROCEED); | |
118 keyPressState = 0; | |
119 } | |
120 } else { | |
121 keyPressState = 0; | |
122 } | |
123 } | |
124 | |
125 // Supports UMA timing, which starts after the warning is first viewed. | |
126 function handleFocusEvent() { | |
127 if (gainFocus == false) { | |
128 sendCommand(CMD_FOCUS); | |
129 gainFocus = true; | |
130 } | |
131 } | |
132 | |
133 // UI modifications and event listeners that take place after load. | |
134 function setupEvents() { | |
135 if (templateData.errorType == "overridable") { | |
136 // This is the blocking page you can click through. | |
137 $('proceed-button').hidden = false; | |
138 $('proceed-button').addEventListener('click', function() { | |
139 sendCommand(CMD_PROCEED); | |
140 }); | |
141 } else { | |
142 document.addEventListener('keypress', keyPressHandler); | |
143 } | |
144 | |
145 if ($('more-info-title').textContent == '') { | |
146 $('more-info-short').hidden = true; | |
147 $('more-info-long').hidden = true; | |
148 $('twisty-closed').style.display = 'none'; | |
149 } else { | |
150 $('more-info-short').addEventListener('click', function() { | |
151 toggleMoreInfo(false); | |
152 }); | |
153 $('more-info-long').addEventListener('click', function() { | |
154 toggleMoreInfo(true); | |
155 }); | |
156 } | |
157 | |
158 $('exit-button').addEventListener('click', function() { | |
159 sendCommand(CMD_DONT_PROCEED); | |
160 }); | |
161 | |
162 document.addEventListener('contextmenu', function(e) { | |
163 e.preventDefault(); | |
164 }); | |
165 } | |
166 | |
167 window.addEventListener('focus', handleFocusEvent); | |
168 document.addEventListener('DOMContentLoaded', setupEvents); | |
169 </script> | |
170 </head> | 83 </head> |
171 <body> | 84 <body> |
172 <div class="box"> | 85 <div class="box"> |
173 <div class="icon"> | 86 <div class="icon"> |
174 <img src="roadblock_icon.png" alt="SSL Error Icon" id="roadblock-icon"> | 87 <img src="roadblock_icon.png" alt="SSL Error Icon" id="roadblock-icon"> |
175 </div> | 88 </div> |
176 <div class="title" i18n-content="headLine"></div> | 89 <div class="title" i18n-content="headLine"></div> |
177 <div class="main" i18n-values=".innerHTML:description;dir:textdirection"></d
iv> | 90 <div class="main" i18n-values=".innerHTML:description;dir:textdirection"></d
iv> |
178 <div class="main" i18n-values=".innerHTML:reasonForNotProceeding"></div> | 91 <div class="main" i18n-values=".innerHTML:reasonForNotProceeding"></div> |
179 <div class="main"> | 92 <div class="main"> |
(...skipping 15 matching lines...) Expand all Loading... |
195 <p i18n-values=".innerHTML:moreInfo1"></p> | 108 <p i18n-values=".innerHTML:moreInfo1"></p> |
196 <p i18n-values=".innerHTML:moreInfo2"></p> | 109 <p i18n-values=".innerHTML:moreInfo2"></p> |
197 <p i18n-values=".innerHTML:moreInfo3"></p> | 110 <p i18n-values=".innerHTML:moreInfo3"></p> |
198 <p i18n-values=".innerHTML:moreInfo4"></p> | 111 <p i18n-values=".innerHTML:moreInfo4"></p> |
199 <p i18n-values=".innerHTML:moreInfo5"></p> | 112 <p i18n-values=".innerHTML:moreInfo5"></p> |
200 </div> | 113 </div> |
201 </div> | 114 </div> |
202 </table> | 115 </table> |
203 </body> | 116 </body> |
204 </html> | 117 </html> |
OLD | NEW |