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

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

Issue 480393002: Move the security interstitials into a single folder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments Created 6 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 unified diff | Download patch | Annotate | Revision Log
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_MORE = 2;
9 var CMD_RELOAD = 3;
10 var CMD_HELP = 4;
11 var CMD_CLOCK = 5;
12
13 var keyPressState = 0;
14
15 function $(o) {
16 return document.getElementById(o);
17 }
18
19 function sendCommand(cmd) {
20 window.domAutomationController.setAutomationId(1);
21 window.domAutomationController.send(cmd);
22 }
23
24 // This allows errors to be skippped by typing "danger" into the page.
25 function keyPressHandler(e) {
26 var sequence = 'danger';
27 if (sequence.charCodeAt(keyPressState) == e.keyCode) {
28 keyPressState++;
29 if (keyPressState == sequence.length) {
30 sendCommand(CMD_PROCEED);
31 keyPressState = 0;
32 }
33 } else {
34 keyPressState = 0;
35 }
36 }
37
38 function sharedSetup() {
39 document.addEventListener('contextmenu', function(e) {
40 e.preventDefault();
41 });
42 document.addEventListener('keypress', keyPressHandler);
43 }
44
45 document.addEventListener('DOMContentLoaded', sharedSetup);
46
OLDNEW
« no previous file with comments | « chrome/browser/resources/ssl/interstitial_v2.js ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698