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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ssl/ssl_errors_common.js
diff --git a/chrome/browser/resources/ssl/ssl_errors_common.js b/chrome/browser/resources/ssl/ssl_errors_common.js
new file mode 100644
index 0000000000000000000000000000000000000000..2c488e3e4fb82d457dd6d892d4b409112b530e41
--- /dev/null
+++ b/chrome/browser/resources/ssl/ssl_errors_common.js
@@ -0,0 +1,44 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Should match SSLBlockingPageCommands in ssl_blocking_page.cc.
+var CMD_DONT_PROCEED = 0;
+var CMD_PROCEED = 1;
+var CMD_FOCUS = 2;
+var CMD_MORE = 3;
+var CMD_RELOAD = 4;
+
+var keyPressState = 0;
+
+function $(o) {
+ return document.getElementById(o);
+}
+
+function sendCommand(cmd) {
+ window.domAutomationController.setAutomationId(1);
+ window.domAutomationController.send(cmd);
+}
+
+// This allows errors to be skippped by typing "proceed" into the page.
+function keyPressHandler(e) {
+ var sequence = 'proceed';
+ if (sequence.charCodeAt(keyPressState) == e.keyCode) {
+ keyPressState++;
+ if (keyPressState == sequence.length) {
+ sendCommand(CMD_PROCEED);
+ keyPressState = 0;
+ }
+ } else {
+ keyPressState = 0;
+ }
+}
+
+function sharedSetup() {
+ document.addEventListener('contextmenu', function(e) {
+ e.preventDefault();
+ });
+ document.addEventListener('keypress', keyPressHandler);
+}
+
+document.addEventListener('DOMContentLoaded', sharedSetup);
« 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