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

Side by Side Diff: chrome/browser/resources/safe_browsing/malware_block_v2.js

Issue 14752005: Finch experiments on SSL, malware, and phishing interstitials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed files in ssl subdirectory Created 7 years, 7 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Sends a command message to SafeBrowsingBlockingPage::CommandReceived. 6 * Sends a command message to SafeBrowsingBlockingPage::CommandReceived.
7 * @param {string} cmd The command to send. 7 * @param {string} cmd The command to send.
8 */ 8 */
9 function sendCommand(cmd) { 9 function sendCommand(cmd) {
10 window.domAutomationController.setAutomationId(1); 10 window.domAutomationController.setAutomationId(1);
(...skipping 20 matching lines...) Expand all
31 $('see-less-text').hidden = false; 31 $('see-less-text').hidden = false;
32 $('see-more-contents').hidden = false; 32 $('see-more-contents').hidden = false;
33 sendCommand('expandedSeeMore'); 33 sendCommand('expandedSeeMore');
34 } else { 34 } else {
35 $('see-more-text').hidden = false; 35 $('see-more-text').hidden = false;
36 $('see-less-text').hidden = true; 36 $('see-less-text').hidden = true;
37 $('see-more-contents').hidden = true; 37 $('see-more-contents').hidden = true;
38 } 38 }
39 } 39 }
40 40
41 function setupFinch() {
James Hawkins 2013/05/01 23:21:45 What is Finch? That's a rhetorical question. The
felt 2013/05/02 16:07:12 Done.
42 var condition = templateData.trialType;
43 if (condition == '' || condition == 'Default') {
44 return; // This is the most common case.
45 } else if (condition == 'Cond2MalwareNoBrand' ||
46 condition == 'Cond4PhishingNoBrand') {
47 $('logo').style.display = 'none';
48 } else if (condition == 'Cond5MalwareOneStep' ||
49 condition == 'Cond6PhishingOneStep') {
50 $('see-more-contents').hidden = false;
51 $('see-less-text').hidden = true;
52 $('see-more-text').hidden = true;
53 }
54 }
55
41 /** 56 /**
42 * Onload listener to initialize javascript handlers. 57 * Onload listener to initialize javascript handlers.
43 */ 58 */
44 document.addEventListener('DOMContentLoaded', function() { 59 document.addEventListener('DOMContentLoaded', function() {
45 $('proceed-span').hidden = templateData.proceedDisabled; 60 $('proceed-span').hidden = templateData.proceedDisabled;
46 61
47 $('back').onclick = function() { 62 $('back').onclick = function() {
48 sendCommand('takeMeBack'); 63 sendCommand('takeMeBack');
49 }; 64 };
50 $('proceed').onclick = function(e) { 65 $('proceed').onclick = function(e) {
(...skipping 13 matching lines...) Expand all
64 // preventDefaultOnPoundLinkClicks doesn't work for this link since it 79 // preventDefaultOnPoundLinkClicks doesn't work for this link since it
65 // contains <span>s, which confuse preventDefaultOnPoundLinkClicks. 80 // contains <span>s, which confuse preventDefaultOnPoundLinkClicks.
66 e.preventDefault(); 81 e.preventDefault();
67 }; 82 };
68 $('check-report').onclick = savePreference; 83 $('check-report').onclick = savePreference;
69 84
70 // All the links are handled by javascript sending commands back to the C++ 85 // All the links are handled by javascript sending commands back to the C++
71 // handler, we don't want the default actions. 86 // handler, we don't want the default actions.
72 preventDefaultOnPoundLinkClicks(); // From webui/js/util.js. 87 preventDefaultOnPoundLinkClicks(); // From webui/js/util.js.
73 88
89 setupFinch();
90
74 // Allow jsdisplay elements to be visible now. 91 // Allow jsdisplay elements to be visible now.
75 document.documentElement.classList.remove('loading'); 92 document.documentElement.classList.remove('loading');
76 }); 93 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698