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

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: move off the record check before UMA stats collection 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 2014 The Chromium Authors. All rights reserved.
Bernhard Bauer 2015/03/03 09:45:58 It's 2015! :) (Alternatively, you can try to conv
estark 2015/03/03 15:36:24 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Must match the commands handled by SafeBrowsingBlockingPage::CommandReceived.
Bernhard Bauer 2015/03/03 09:45:59 'use strict'; ?
estark 2015/03/03 15:36:24 Done.
6 var SB_CMD_DO_REPORT = 'doReport';
7 var SB_CMD_DONT_REPORT = 'dontReport';
8 var SB_CMD_EXPANDED_SEE_MORE = 'expandedSeeMore';
9 var SB_CMD_LEARN_MORE_2 = 'learnMore2';
10 var SB_CMD_PROCEED = 'proceed';
11 var SB_CMD_SHOW_DIAGNOSTIC = 'showDiagnostic';
12 var SB_CMD_SHOW_PRIVACY = 'showPrivacy';
13 var SB_CMD_TAKE_ME_BACK = 'takeMeBack';
14
15 // Other constants defined in security_interstitial_page.h.
16 var SB_BOX_CHECKED = 'boxchecked';
17 var SB_DISPLAY_CHECK_BOX = 'displaycheckbox';
18
19 // This sets up the Extended Safe Browsing Reporting opt-in, either for
20 // reporting malware or invalid certificate chains. Does nothing if the
21 // interstitial type is not SAFEBROWSING or SSL.
22 function setupExtendedReportingCheckbox() {
23 var interstitialType = loadTimeData.getString('type');
24 if (interstitialType != 'SAFEBROWSING' && interstitialType != 'SSL') {
25 return;
26 }
27
28 if (!loadTimeData.getBoolean(SB_DISPLAY_CHECK_BOX)) {
29 return;
30 }
31
32 $('opt-in-label').innerHTML = loadTimeData.getString('optInLink');
33 $('opt-in-checkbox').checked = loadTimeData.getBoolean(SB_BOX_CHECKED);
34 $('extended-reporting-opt-in').classList.remove('hidden');
35 $('extended-reporting-opt-in').classList.add(
36 interstitialType == 'SAFEBROWSING' ? 'safe-browsing-opt-in' : 'ssl-opt-in');
Bernhard Bauer 2015/03/03 09:45:58 This should be indented four spaces (which sadly m
estark 2015/03/03 15:36:24 Done.
37 $('body').classList.add('extended-reporting-has-checkbox');
38
39 $('opt-in-checkbox').addEventListener('click', function() {
40 var command;
41 if ($('opt-in-checkbox').checked) {
42 command = interstitialType == 'SAFEBROWSING' ?
43 SB_CMD_DO_REPORT : SSL_CMD_DO_REPORT;
Bernhard Bauer 2015/03/03 09:45:59 Indent four spaces.
estark 2015/03/03 15:36:24 Done.
44 } else {
45 command = interstitialType == 'SAFEBROWSING' ?
46 SB_CMD_DONT_REPORT : SSL_CMD_DONT_REPORT;
47 }
48 sendCommand(command);
49 });
50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698