| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This is the shared code for the new (Chrome 37) security interstitials. It is | 5 // This is the shared code for the new (Chrome 37) security interstitials. It is |
| 6 // used for both SSL interstitials and Safe Browsing interstitials. | 6 // used for both SSL interstitials and Safe Browsing interstitials. |
| 7 | 7 |
| 8 var expandedDetails = false; | 8 var expandedDetails = false; |
| 9 var keyPressState = 0; | 9 var keyPressState = 0; |
| 10 | 10 |
| 11 // Should match security_interstitials::SecurityInterstitialCommands | 11 // Should match security_interstitials::SecurityInterstitialCommands |
| 12 var CMD_DONT_PROCEED = 0; | 12 var CMD_DONT_PROCEED = 0; |
| 13 var CMD_PROCEED = 1; | 13 var CMD_PROCEED = 1; |
| 14 // Ways for user to get more information | 14 // Ways for user to get more information |
| 15 var CMD_SHOW_MORE_SECTION = 2; | 15 var CMD_SHOW_MORE_SECTION = 2; |
| 16 var CMD_OPEN_HELP_CENTER = 3; | 16 var CMD_OPEN_HELP_CENTER = 3; |
| 17 var CMD_OPEN_DIAGNOSTIC = 4; | 17 var CMD_OPEN_DIAGNOSTIC = 4; |
| 18 // Primary button actions | 18 // Primary button actions |
| 19 var CMD_RELOAD = 5; | 19 var CMD_RELOAD = 5; |
| 20 var CMD_OPEN_DATE_SETTINGS = 6; | 20 var CMD_OPEN_DATE_SETTINGS = 6; |
| 21 var CMD_OPEN_LOGIN = 7; | 21 var CMD_OPEN_LOGIN = 7; |
| 22 // Safe Browsing Extended Reporting | 22 // Safe Browsing Extended Reporting |
| 23 var CMD_DO_REPORT = 8; | 23 var CMD_DO_REPORT = 8; |
| 24 var CMD_DONT_REPORT = 9; | 24 var CMD_DONT_REPORT = 9; |
| 25 var CMD_OPEN_REPORTING_PRIVACY = 10; | 25 var CMD_OPEN_REPORTING_PRIVACY = 10; |
| 26 var CMD_OPEN_WHITEPAPER = 11; |
| 26 // Report a phishing error. | 27 // Report a phishing error. |
| 27 var CMD_REPORT_PHISHING_ERROR = 11; | 28 var CMD_REPORT_PHISHING_ERROR = 12; |
| 28 | 29 |
| 29 /** | 30 /** |
| 30 * A convenience method for sending commands to the parent page. | 31 * A convenience method for sending commands to the parent page. |
| 31 * @param {string} cmd The command to send. | 32 * @param {string} cmd The command to send. |
| 32 */ | 33 */ |
| 33 function sendCommand(cmd) { | 34 function sendCommand(cmd) { |
| 34 <if expr="not is_ios"> | 35 <if expr="not is_ios"> |
| 35 window.domAutomationController.setAutomationId(1); | 36 window.domAutomationController.setAutomationId(1); |
| 36 window.domAutomationController.send(cmd); | 37 window.domAutomationController.send(cmd); |
| 37 </if> | 38 </if> |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 }); | 202 }); |
| 202 } | 203 } |
| 203 | 204 |
| 204 preventDefaultOnPoundLinkClicks(); | 205 preventDefaultOnPoundLinkClicks(); |
| 205 setupExtendedReportingCheckbox(); | 206 setupExtendedReportingCheckbox(); |
| 206 setupSSLDebuggingInfo(); | 207 setupSSLDebuggingInfo(); |
| 207 document.addEventListener('keypress', handleKeypress); | 208 document.addEventListener('keypress', handleKeypress); |
| 208 } | 209 } |
| 209 | 210 |
| 210 document.addEventListener('DOMContentLoaded', setupEvents); | 211 document.addEventListener('DOMContentLoaded', setupEvents); |
| OLD | NEW |