OLD | NEW |
---|---|
(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' ? 'safe-browsing-opt-in' : | |
29 'ssl-opt-in'; | |
Ryan Sleevi
2015/03/25 04:49:45
Don't think this seems consistent with https://goo
estark
2015/03/25 05:34:33
Done.
| |
30 $('extended-reporting-opt-in').classList.add(className); | |
31 | |
32 $('body').classList.add('extended-reporting-has-checkbox'); | |
33 | |
34 $('opt-in-checkbox').addEventListener('click', function() { | |
35 sendCommand( | |
36 $('opt-in-checkbox').checked ? CMD_DO_REPORT : CMD_DONT_REPORT); | |
Ryan Sleevi
2015/03/25 04:49:45
ditto this
estark
2015/03/25 05:34:33
Done.
| |
37 }); | |
38 } | |
OLD | NEW |