Index: chrome/browser/resources/ssl/overridable_v2.js |
diff --git a/chrome/browser/resources/ssl/overridable_v2.js b/chrome/browser/resources/ssl/overridable_v2.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0ef4d089d2d99dd612eb91daceb40e3cb8d1ca9f |
--- /dev/null |
+++ b/chrome/browser/resources/ssl/overridable_v2.js |
@@ -0,0 +1,39 @@ |
+// Copyright 2014 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. |
+ |
+var expandedDetails = false; |
+var touch = 'touchend'; |
+var click = 'click'; |
+ |
+function toggleDetails() { |
+ $('details').classList.toggle('hidden'); |
+ $('details-button').innerText = $('details').classList.contains('hidden') ? |
+ templateData.openDetails : templateData.closeDetails; |
+ if (!expandedDetails) { |
+ // Record a histogram entry only the first time that details is opened. |
+ sendCommand(CMD_MORE); |
+ expandedDetails = true; |
+ } |
+} |
+ |
+function setupEvents() { |
+ $('safety-button').addEventListener(touch, function() { |
+ sendCommand(CMD_DONT_PROCEED); |
+ }); |
+ $('safety-button').addEventListener(click, function() { |
+ sendCommand(CMD_DONT_PROCEED); |
Bernhard Bauer
2014/05/27 14:13:34
Alternatively, you could assign the two event name
|
+ }); |
+ |
+ $('proceed-link').addEventListener(touch, function() { |
+ sendCommand(CMD_PROCEED); |
+ }); |
+ $('proceed-link').addEventListener(click, function() { |
+ sendCommand(CMD_PROCEED); |
+ }); |
+ |
+ $('details-button').addEventListener(touch, toggleDetails); |
+ $('details-button').addEventListener(click, toggleDetails); |
+} |
+ |
+document.addEventListener('DOMContentLoaded', setupEvents); |