OLD | NEW |
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 // Must match the commands handled by SafeBrowsingBlockingPage::CommandReceived. | 5 // Must match the commands handled by SafeBrowsingBlockingPage::CommandReceived. |
6 var SB_CMD_DO_REPORT = 'doReport'; | 6 var SB_CMD_DO_REPORT = 'doReport'; |
7 var SB_CMD_DONT_REPORT = 'dontReport'; | 7 var SB_CMD_DONT_REPORT = 'dontReport'; |
8 var SB_CMD_EXPANDED_SEE_MORE = 'expandedSeeMore'; | 8 var SB_CMD_EXPANDED_SEE_MORE = 'expandedSeeMore'; |
9 var SB_CMD_LEARN_MORE_2 = 'learnMore2'; | 9 var SB_CMD_LEARN_MORE_2 = 'learnMore2'; |
10 var SB_CMD_PROCEED = 'proceed'; | 10 var SB_CMD_PROCEED = 'proceed'; |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 $('opt-in-label').innerHTML = loadTimeData.getString('optInLink'); | 27 $('opt-in-label').innerHTML = loadTimeData.getString('optInLink'); |
28 $('opt-in-checkbox').checked = loadTimeData.getBoolean(SB_BOX_CHECKED); | 28 $('opt-in-checkbox').checked = loadTimeData.getBoolean(SB_BOX_CHECKED); |
29 $('malware-opt-in').classList.remove('hidden'); | 29 $('malware-opt-in').classList.remove('hidden'); |
30 | 30 |
31 $('opt-in-checkbox').addEventListener('click', function() { | 31 $('opt-in-checkbox').addEventListener('click', function() { |
32 sendCommand( | 32 sendCommand( |
33 $('opt-in-checkbox').checked ? SB_CMD_DO_REPORT : SB_CMD_DONT_REPORT); | 33 $('opt-in-checkbox').checked ? SB_CMD_DO_REPORT : SB_CMD_DONT_REPORT); |
34 }); | 34 }); |
35 } | 35 } |
36 | |
37 function setupMalwareFinchExperiment() { | |
38 if (loadTimeData.getString('trialCondition') != 'V3Advice') | |
39 return; | |
40 // Add all this dynamically instead of into the HTML because it's just a | |
41 // short-lived experiment. | |
42 var heading = document.createElement('h2'); | |
43 heading.innerText = loadTimeData.getString('adviceHeading'); | |
44 $('details').insertBefore(heading, $('details').firstChild); | |
45 } | |
OLD | NEW |