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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/safe_browsing/safe_browsing_v3.js
diff --git a/chrome/browser/resources/safe_browsing/safe_browsing_v3.js b/chrome/browser/resources/safe_browsing/safe_browsing_v3.js
index 519a5824b94bd040146f5b331f38b392eebe42ff..ac12893f64b2ef1e46f83a5d514e0308a44c33cd 100644
--- a/chrome/browser/resources/safe_browsing/safe_browsing_v3.js
+++ b/chrome/browser/resources/safe_browsing/safe_browsing_v3.js
@@ -16,3 +16,21 @@ var SB_CMD_TAKE_ME_BACK = 'takeMeBack';
// Other constants defined in safe_browsing_blocking_page.cc.
var SB_BOX_CHECKED = 'boxchecked';
var SB_DISPLAY_CHECK_BOX = 'displaycheckbox';
+
+// This sets up the Extended Safe Browsing Reporting opt-in.
+function setupCheckbox() {
+ if (loadTimeData.getBoolean('ssl')) return;
+ 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
+ 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.
+
+ $('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.
+ $('optin-checkbox').checked = loadTimeData.getBoolean(SB_BOX_CHECKED);
+ $('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
+
+ $('optin-checkbox').addEventListener('click', function() {
+ if ($('optin-checkbox').checked)
+ sendCommand(SB_CMD_DO_REPORT);
+ else
+ sendCommand(SB_CMD_DONT_REPORT);
Dan Beam 2014/06/16 19:05:50 ternary, imo
felt 2014/06/17 05:41:54 Done.
+ });
+}
« 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