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

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

Issue 935663004: Add checkbox for reporting invalid TLS/SSL cert chains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert accidental deletion (fixes failing CaptivePortal tests) Created 5 years, 9 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 'use strict';
6
7 // Other constants defined in security_interstitial_page.h.
8 var SB_BOX_CHECKED = 'boxchecked';
9 var SB_DISPLAY_CHECK_BOX = 'displaycheckbox';
10
11 // This sets up the Extended Safe Browsing Reporting opt-in, either for
12 // reporting malware or invalid certificate chains. Does nothing if the
13 // interstitial type is not SAFEBROWSING or SSL.
14 function setupExtendedReportingCheckbox() {
15 var interstitialType = loadTimeData.getString('type');
16 if (interstitialType != 'SAFEBROWSING' && interstitialType != 'SSL') {
17 return;
18 }
19
20 if (!loadTimeData.getBoolean(SB_DISPLAY_CHECK_BOX)) {
21 return;
22 }
23
24 $('opt-in-label').innerHTML = loadTimeData.getString('optInLink');
25 $('opt-in-checkbox').checked = loadTimeData.getBoolean(SB_BOX_CHECKED);
26 $('extended-reporting-opt-in').classList.remove('hidden');
27
28 var className = interstitialType == 'SAFEBROWSING' ?
29 'safe-browsing-opt-in' :
30 'ssl-opt-in';
31 $('extended-reporting-opt-in').classList.add(className);
32
33 $('body').classList.add('extended-reporting-has-checkbox');
34
35 $('opt-in-checkbox').addEventListener('click', function() {
36 sendCommand($('opt-in-checkbox').checked ?
37 CMD_DO_REPORT :
38 CMD_DONT_REPORT);
39 });
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698