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 // Details appears over the main content on small screens. |
| 144 if (mobileNav) { |
| 145 $('main-content').classList.toggle('hidden'); |
| 146 } |
| 147 |
142 $('details-button').innerText = hiddenDetails ? | 148 $('details-button').innerText = hiddenDetails ? |
143 loadTimeData.getString('openDetails') : | 149 loadTimeData.getString('openDetails') : |
144 loadTimeData.getString('closeDetails'); | 150 loadTimeData.getString('closeDetails'); |
145 if (!expandedDetails) { | 151 if (!expandedDetails) { |
146 // Record a histogram entry only the first time that details is opened. | 152 // Record a histogram entry only the first time that details is opened. |
147 sendCommand(ssl ? SSL_CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); | 153 sendCommand(ssl ? SSL_CMD_MORE : SB_CMD_EXPANDED_SEE_MORE); |
148 expandedDetails = true; | 154 expandedDetails = true; |
149 } | 155 } |
150 }); | 156 }); |
151 } | 157 } |
152 | 158 |
153 preventDefaultOnPoundLinkClicks(); | 159 preventDefaultOnPoundLinkClicks(); |
154 setupCheckbox(); | 160 setupCheckbox(); |
155 setupSSLDebuggingInfo(); | 161 setupSSLDebuggingInfo(); |
156 document.addEventListener('keypress', handleKeypress); | 162 document.addEventListener('keypress', handleKeypress); |
157 } | 163 } |
158 | 164 |
159 document.addEventListener('DOMContentLoaded', setupEvents); | 165 document.addEventListener('DOMContentLoaded', setupEvents); |
OLD | NEW |