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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/ssl/interstitial_v2.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Must match the commands handled by SafeBrowsingBlockingPage::CommandReceived.
6 var SB_CMD_DO_REPORT = 'doReport';
7 var SB_CMD_DONT_REPORT = 'dontReport';
8 var SB_CMD_EXPANDED_SEE_MORE = 'expandedSeeMore';
9 var SB_CMD_LEARN_MORE_2 = 'learnMore2';
10 var SB_CMD_PROCEED = 'proceed';
11 var SB_CMD_REPORT_ERROR = 'reportError';
12 var SB_CMD_SHOW_DIAGNOSTIC = 'showDiagnostic';
13 var SB_CMD_SHOW_PRIVACY = 'showPrivacy';
14 var SB_CMD_TAKE_ME_BACK = 'takeMeBack';
15
16 // Other constants defined in safe_browsing_blocking_page.cc.
17 var SB_BOX_CHECKED = 'boxchecked';
18 var SB_DISPLAY_CHECK_BOX = 'displaycheckbox';
19
20 function applySafeBrowsingStyle() {
21 // Dynamically add the second and third paragraphs.
22 var secondParagraph = document.createTextNode(
23 loadTimeData.getString('secondParagraph'));
24 $('second-paragraph').appendChild(secondParagraph);
25 if (!loadTimeData.getBoolean('phishing')) {
26 var thirdParagraph = document.createTextNode(
27 loadTimeData.getString('thirdParagraph'));
28 $('third-paragraph').appendChild(thirdParagraph);
29 }
30
31 // Add the link to the diagnostic page (malware) or reporting (phishing).
32 // TODO(felt): Put the link definition into the grd file once we have new
33 // wording.
34 var detailsText = document.createTextNode(
35 loadTimeData.getString('detailsText'));
36 var detailsLink = document.createElement('a');
37 detailsLink.setAttribute('href', '#');
38 detailsLink.setAttribute('id', 'help-link');
39 detailsLink.appendChild(detailsText);
40 $('explanation-paragraph').appendChild(detailsLink);
41
42 // Add the link to proceed.
43 if (loadTimeData.getBoolean('overridable')) {
44 var proceedText = document.createTextNode(
45 loadTimeData.getString('proceedText'));
46 var proceedLink = document.createElement('a');
47 proceedLink.setAttribute('href', '#');
48 proceedLink.setAttribute('id', 'proceed-link');
49 proceedLink.appendChild(proceedText);
50 $('final-paragraph').appendChild(proceedLink);
51 }
52
53 // Swap in the appropriate styling.
54 $('body').classList.add('safe-browsing');
55
56 // Remove the 'hidden' class from the paragraphs that we use.
57 $('second-paragraph').classList.toggle('hidden');
58 if (!loadTimeData.getBoolean('phishing'))
59 $('third-paragraph').classList.toggle('hidden');
60 $('explanation-paragraph').classList.toggle('hidden');
61 $('final-paragraph').classList.toggle('hidden');
62 }
OLDNEW
« 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