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

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: Rebased again 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..bab8a0dd25f8c30097b7366e84251f085305e784
--- /dev/null
+++ b/chrome/browser/resources/safe_browsing/safe_browsing_v3.js
@@ -0,0 +1,62 @@
+// 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_DO_REPORT = 'doReport';
+var SB_CMD_DONT_REPORT = 'dontReport';
+var SB_CMD_EXPANDED_SEE_MORE = 'expandedSeeMore';
+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';
+
+// Other constants defined in safe_browsing_blocking_page.cc.
+var SB_BOX_CHECKED = 'boxchecked';
+var SB_DISPLAY_CHECK_BOX = 'displaycheckbox';
+
+function applySafeBrowsingStyle() {
+ // 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);
+ }
+
+ // Swap in the appropriate styling.
+ $('body').classList.add('safe-browsing');
+
+ // 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