| 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 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 sendCommand(SB_CMD_SHOW_DIAGNOSTIC); | 132 sendCommand(SB_CMD_SHOW_DIAGNOSTIC); |
| 133 }); | 133 }); |
| 134 } | 134 } |
| 135 | 135 |
| 136 if (captivePortal) { | 136 if (captivePortal) { |
| 137 // Captive portal page doesn't have details button. | 137 // Captive portal page doesn't have details button. |
| 138 $('details-button').classList.add('hidden'); | 138 $('details-button').classList.add('hidden'); |
| 139 } else { | 139 } else { |
| 140 $('details-button').addEventListener('click', function(event) { | 140 $('details-button').addEventListener('click', function(event) { |
| 141 var hiddenDetails = $('details').classList.toggle('hidden'); | 141 var hiddenDetails = $('details').classList.toggle('hidden'); |
| 142 |
| 143 if (mobileNav) { |
| 144 // Details appear over the main content on small screens. |
| 145 $('main-content').classList.toggle('hidden', !hiddenDetails); |
| 146 } else { |
| 147 $('main-content').classList.remove('hidden'); |
| 148 } |
| 149 |
| 142 $('details-button').innerText = hiddenDetails ? | 150 $('details-button').innerText = hiddenDetails ? |
| 143 loadTimeData.getString('openDetails') : | 151 loadTimeData.getString('openDetails') : |
| 144 loadTimeData.getString('closeDetails'); | 152 loadTimeData.getString('closeDetails'); |
| 145 if (!expandedDetails) { | 153 if (!expandedDetails) { |
| 146 // Record a histogram entry only the first time that details is opened. | 154 // Record a histogram entry only the first time that details is opened. |
| 147 sendCommand(ssl ? SSL_CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); | 155 sendCommand(ssl ? SSL_CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); |
| 148 expandedDetails = true; | 156 expandedDetails = true; |
| 149 } | 157 } |
| 150 }); | 158 }); |
| 151 } | 159 } |
| 152 | 160 |
| 153 preventDefaultOnPoundLinkClicks(); | 161 preventDefaultOnPoundLinkClicks(); |
| 154 setupCheckbox(); | 162 setupCheckbox(); |
| 155 setupSSLDebuggingInfo(); | 163 setupSSLDebuggingInfo(); |
| 156 document.addEventListener('keypress', handleKeypress); | 164 document.addEventListener('keypress', handleKeypress); |
| 157 } | 165 } |
| 158 | 166 |
| 159 document.addEventListener('DOMContentLoaded', setupEvents); | 167 document.addEventListener('DOMContentLoaded', setupEvents); |
| OLD | NEW |