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

Side by Side Diff: components/security_interstitials/core/browser/resources/interstitial_v2.js

Issue 2895923003: Small interstitial JS cleanup (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 loadTimeData.getString('openDetails') : 150 loadTimeData.getString('openDetails') :
151 loadTimeData.getString('closeDetails'); 151 loadTimeData.getString('closeDetails');
152 if (!expandedDetails) { 152 if (!expandedDetails) {
153 // Record a histogram entry only the first time that details is opened. 153 // Record a histogram entry only the first time that details is opened.
154 sendCommand(SecurityInterstitialCommandId.CMD_SHOW_MORE_SECTION); 154 sendCommand(SecurityInterstitialCommandId.CMD_SHOW_MORE_SECTION);
155 expandedDetails = true; 155 expandedDetails = true;
156 } 156 }
157 }); 157 });
158 } 158 }
159 159
160 // TODO(felt): This should be simplified once the Finch trial is no longer 160 if ($('report-error-link')) {
161 // needed.
162 if (interstitialType == 'SAFEBROWSING' &&
163 loadTimeData.getBoolean('phishing') && $('report-error-link')) {
164 $('report-error-link').addEventListener('click', function(event) { 161 $('report-error-link').addEventListener('click', function(event) {
165 sendCommand(SecurityInterstitialCommandId.CMD_REPORT_PHISHING_ERROR); 162 sendCommand(SecurityInterstitialCommandId.CMD_REPORT_PHISHING_ERROR);
166 }); 163 });
167 } 164 }
168 165
169 preventDefaultOnPoundLinkClicks(); 166 preventDefaultOnPoundLinkClicks();
170 setupExtendedReportingCheckbox(); 167 setupExtendedReportingCheckbox();
171 setupSSLDebuggingInfo(); 168 setupSSLDebuggingInfo();
172 document.addEventListener('keypress', handleKeypress); 169 document.addEventListener('keypress', handleKeypress);
173 } 170 }
174 171
175 document.addEventListener('DOMContentLoaded', setupEvents); 172 document.addEventListener('DOMContentLoaded', setupEvents);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698