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

Side by Side Diff: chrome/browser/resources/ssl/ssl_errors_common.js

Issue 23965003: New SSL blocking screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ssl/roadblock.js ('k') | chrome/browser/ssl/ssl_blocking_page.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Should match SSLBlockingPageCommands in ssl_blocking_page.cc.
6 var CMD_DONT_PROCEED = 0;
7 var CMD_PROCEED = 1;
8 var CMD_FOCUS = 2;
9 var CMD_MORE = 3;
10 var CMD_RELOAD = 4;
11
12 var keyPressState = 0;
13
14 function $(o) {
15 return document.getElementById(o);
16 }
17
18 function sendCommand(cmd) {
19 window.domAutomationController.setAutomationId(1);
20 window.domAutomationController.send(cmd);
21 }
22
23 // This allows errors to be skippped by typing "proceed" into the page.
24 function keyPressHandler(e) {
25 var sequence = 'proceed';
26 if (sequence.charCodeAt(keyPressState) == e.keyCode) {
27 keyPressState++;
28 if (keyPressState == sequence.length) {
29 sendCommand(CMD_PROCEED);
30 keyPressState = 0;
31 }
32 } else {
33 keyPressState = 0;
34 }
35 }
36
37 function sharedSetup() {
38 document.addEventListener('contextmenu', function(e) {
39 e.preventDefault();
40 });
41 document.addEventListener('keypress', keyPressHandler);
42 }
43
44 document.addEventListener('DOMContentLoaded', sharedSetup);
OLDNEW
« no previous file with comments | « chrome/browser/resources/ssl/roadblock.js ('k') | chrome/browser/ssl/ssl_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698