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

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: Fixed comments for bauerb 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
(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_BOX_CHECKED = 'boxchecked';
7 var SB_CMD_DISPLAY_CHECK = 'displaycheckbox';
Bernhard Bauer 2014/06/09 14:45:41 Hm, this is called kDisplayCheckBox in safe_browsi
felt 2014/06/09 15:24:02 These need to be JS style though right? I was tryi
Bernhard Bauer 2014/06/09 15:43:00 Yes, but with _BOX at the end please.
felt 2014/06/09 16:55:27 Done. Apparently my brain cannot see the differenc
8 var SB_CMD_DO_REPORT = 'doReport';
9 var SB_CMD_DONT_REPORT = 'dontReport';
10 var SB_CMD_EXPANDED_MORE = 'expandedSeeMore';
11 var SB_CMD_GO_BACK = 'takeMeBack';
Bernhard Bauer 2014/06/09 14:45:41 This one is called kTakeMeBackCommand.
felt 2014/06/09 15:24:02 Done.
12 var SB_CMD_LEARN_MORE = 'learnMore2';
Bernhard Bauer 2014/06/09 14:45:42 This one is called kLearnMoreCommandV2.
felt 2014/06/09 15:24:02 Done.
13 var SB_CMD_PROCEED = 'proceed';
14 var SB_CMD_REPORT_ERROR = 'reportError';
15 var SB_CMD_SHOW_DIAGNOSTIC = 'showDiagnostic';
16 var SB_CMD_SHOW_PRIVACY = 'showPrivacy';
17
18 function applyMalwareStyle() {
19 // Dynamically add the second and third paragraphs.
20 var secondParagraph = document.createTextNode(
21 loadTimeData.getString('secondParagraph'));
22 $('second-paragraph').appendChild(secondParagraph);
23 if (!loadTimeData.getBoolean('phishing')) {
24 var thirdParagraph = document.createTextNode(
25 loadTimeData.getString('thirdParagraph'));
26 $('third-paragraph').appendChild(thirdParagraph);
27 }
28
29 // Add the link to the diagnostic page (malware) or reporting (phishing).
30 var detailsText = document.createTextNode(
31 loadTimeData.getString('detailsText'));
32 var detailsLink = document.createElement('a');
33 detailsLink.setAttribute('href', '#');
34 detailsLink.setAttribute('id', 'help-link');
35 detailsLink.appendChild(detailsText);
36 $('explanation-paragraph').appendChild(detailsLink);
37
38 // Add the link to proceed.
39 if (loadTimeData.getBoolean('overridable')) {
40 var proceedText = document.createTextNode(
41 loadTimeData.getString('proceedText'));
42 var proceedLink = document.createElement('a');
43 proceedLink.setAttribute('href', '#');
44 proceedLink.setAttribute('id', 'proceed-link');
45 proceedLink.appendChild(proceedText);
46 $('final-paragraph').appendChild(proceedLink);
47 }
48
49 // Make the background red.
50 $('icon').classList.add('icon-malware');
51 $('body').classList.add('body-red');
52 $('primary-button').classList.add('button-red');
53 var links = document.getElementsByTagName('a');
54 for (var i = 0; i < links.length; i++)
55 links[i].classList.add('a-red');
56
57 // Remove the 'hidden' class from the paragraphs that we use.
58 $('second-paragraph').classList.toggle('hidden');
59 if (!loadTimeData.getBoolean('phishing'))
60 $('third-paragraph').classList.toggle('hidden');
61 $('explanation-paragraph').classList.toggle('hidden');
62 $('final-paragraph').classList.toggle('hidden');
63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698