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

Side by Side Diff: chrome/browser/resources/safe_browsing/safe_browsing_v3.js

Issue 339503004: Add the extended reporting checkbox to the malware interstitial v3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 // 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';
11 var SB_CMD_REPORT_ERROR = 'reportError'; 11 var SB_CMD_REPORT_ERROR = 'reportError';
12 var SB_CMD_SHOW_DIAGNOSTIC = 'showDiagnostic'; 12 var SB_CMD_SHOW_DIAGNOSTIC = 'showDiagnostic';
13 var SB_CMD_SHOW_PRIVACY = 'showPrivacy'; 13 var SB_CMD_SHOW_PRIVACY = 'showPrivacy';
14 var SB_CMD_TAKE_ME_BACK = 'takeMeBack'; 14 var SB_CMD_TAKE_ME_BACK = 'takeMeBack';
15 15
16 // Other constants defined in safe_browsing_blocking_page.cc. 16 // Other constants defined in safe_browsing_blocking_page.cc.
17 var SB_BOX_CHECKED = 'boxchecked'; 17 var SB_BOX_CHECKED = 'boxchecked';
18 var SB_DISPLAY_CHECK_BOX = 'displaycheckbox'; 18 var SB_DISPLAY_CHECK_BOX = 'displaycheckbox';
19
20 // This sets up the Extended Safe Browsing Reporting opt-in.
21 function setupCheckbox() {
22 if (loadTimeData.getBoolean('ssl')) return;
23 if (loadTimeData.getBoolean('phishing')) return;
Dan Beam 2014/06/16 19:05:50 ^ are 'ssl' or 'phishing' defined in a .cc file so
mattm 2014/06/16 21:02:21 I wonder if it should have some single value like
felt 2014/06/17 05:41:54 No. What I want to do down the line is create a pa
24 if (!loadTimeData.getBoolean(SB_DISPLAY_CHECK_BOX)) return;
Dan Beam 2014/06/16 19:05:50 nit: combine if -> returns
felt 2014/06/17 05:41:54 Done.
Dan Beam 2014/06/17 17:52:54 not done, but it was a nit
felt 2014/06/17 18:03:27 Done for realsies.
25
26 $('optin-label').innerHTML = loadTimeData.getString('optinText');
Dan Beam 2014/06/16 19:05:50 can you use .innerText or .textContent instead of
felt 2014/06/17 05:41:54 No, the string has a link in it.
27 $('optin-checkbox').checked = loadTimeData.getBoolean(SB_BOX_CHECKED);
28 $('malware-optin').classList.remove('hidden');
mattm 2014/06/16 21:02:21 Should be possible to do a lot of this without JS,
felt 2014/06/17 05:41:54 Yes, I didn't want to have to set them to empty va
29
30 $('optin-checkbox').addEventListener('click', function() {
31 if ($('optin-checkbox').checked)
32 sendCommand(SB_CMD_DO_REPORT);
33 else
34 sendCommand(SB_CMD_DONT_REPORT);
Dan Beam 2014/06/16 19:05:50 ternary, imo
felt 2014/06/17 05:41:54 Done.
35 });
36 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/ssl/interstitial_v2.css » ('j') | chrome/browser/resources/ssl/interstitial_v2.css » ('J')

Powered by Google App Engine
This is Rietveld 408576698