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

Unified Diff: chrome/browser/resources/safe_browsing/safe_browsing_v3.js

Issue 319193002: Update the malware interstitial to have the new layout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Round 2 of edits 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
« no previous file with comments | « no previous file | chrome/browser/resources/ssl/interstitial_v2.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..186d1bc3cb4487107f5b0af6138b76c4eb13f377
--- /dev/null
+++ b/chrome/browser/resources/safe_browsing/safe_browsing_v3.js
@@ -0,0 +1,65 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Must match the commands handled by SafeBrowsingBlockingPage::CommandReceived.
+var SB_CMD_BOX_CHECKED = 'boxchecked';
+var SB_CMD_DISPLAY_CHECK = 'displaycheckbox';
+var SB_CMD_DO_REPORT = 'doReport';
+var SB_CMD_DONT_REPORT = 'dontReport';
+var SB_CMD_EXPANDED_MORE = 'expandedSeeMore';
Bernhard Bauer 2014/06/09 15:43:00 And this one is kExpandedSeeMore (without Command.
felt 2014/06/09 16:55:27 Done. I don't want to add Command to the end of t
Bernhard Bauer 2014/06/09 17:17:10 Yes, I like that (and I was just lamenting about t
felt 2014/06/09 18:01:36 I'm not sure what distinction you're drawing betwe
Bernhard Bauer 2014/06/09 21:48:27 No, kBoxChecked and kDisplayCheckBox are used as k
felt 2014/06/10 05:21:02 Separated them out.
+var SB_CMD_LEARN_MORE_2 = 'learnMore2';
+var SB_CMD_PROCEED = 'proceed';
+var SB_CMD_REPORT_ERROR = 'reportError';
+var SB_CMD_SHOW_DIAGNOSTIC = 'showDiagnostic';
+var SB_CMD_SHOW_PRIVACY = 'showPrivacy';
+var SB_CMD_TAKE_ME_BACK = 'takeMeBack';
+
+function applyMalwareStyle() {
+ // Dynamically add the second and third paragraphs.
+ var secondParagraph = document.createTextNode(
+ loadTimeData.getString('secondParagraph'));
+ $('second-paragraph').appendChild(secondParagraph);
+ if (!loadTimeData.getBoolean('phishing')) {
+ var thirdParagraph = document.createTextNode(
+ loadTimeData.getString('thirdParagraph'));
+ $('third-paragraph').appendChild(thirdParagraph);
+ }
+
+ // Add the link to the diagnostic page (malware) or reporting (phishing).
+ // TODO(felt): Put the link definition into the grd file once we have new
+ // wording.
+ var detailsText = document.createTextNode(
+ loadTimeData.getString('detailsText'));
+ var detailsLink = document.createElement('a');
+ detailsLink.setAttribute('href', '#');
+ detailsLink.setAttribute('id', 'help-link');
+ detailsLink.appendChild(detailsText);
+ $('explanation-paragraph').appendChild(detailsLink);
+
+ // Add the link to proceed.
+ if (loadTimeData.getBoolean('overridable')) {
+ var proceedText = document.createTextNode(
+ loadTimeData.getString('proceedText'));
+ var proceedLink = document.createElement('a');
+ proceedLink.setAttribute('href', '#');
+ proceedLink.setAttribute('id', 'proceed-link');
+ proceedLink.appendChild(proceedText);
+ $('final-paragraph').appendChild(proceedLink);
+ }
+
+ // Make the background red.
+ $('icon').classList.add('icon-malware');
+ $('body').classList.add('body-red');
+ $('primary-button').classList.add('button-red');
+ var links = document.getElementsByTagName('a');
+ for (var i = 0; i < links.length; i++)
+ links[i].classList.add('a-red');
+
+ // Remove the 'hidden' class from the paragraphs that we use.
+ $('second-paragraph').classList.toggle('hidden');
+ if (!loadTimeData.getBoolean('phishing'))
+ $('third-paragraph').classList.toggle('hidden');
+ $('explanation-paragraph').classList.toggle('hidden');
+ $('final-paragraph').classList.toggle('hidden');
+}
« no previous file with comments | « no previous file | chrome/browser/resources/ssl/interstitial_v2.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698