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

Side by Side Diff: chrome/browser/resources/security_warnings/interstitial_v2.js

Issue 865943002: Update SSL/malware/net error interstitial design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix background colour for nav-wrapper on safe browsing state Created 5 years, 11 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 unified diff | Download patch
OLDNEW
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698