| OLD | NEW |
| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 }; | 49 }; |
| 50 $('proceed').onclick = function(e) { | 50 $('proceed').onclick = function(e) { |
| 51 sendCommand('proceed'); | 51 sendCommand('proceed'); |
| 52 }; | 52 }; |
| 53 $('learn-more-link').onclick = function(e) { | 53 $('learn-more-link').onclick = function(e) { |
| 54 sendCommand('learnMore2'); | 54 sendCommand('learnMore2'); |
| 55 }; | 55 }; |
| 56 $('show-diagnostic-link').onclick = function(e) { | 56 $('show-diagnostic-link').onclick = function(e) { |
| 57 sendCommand('showDiagnostic'); | 57 sendCommand('showDiagnostic'); |
| 58 }; | 58 }; |
| 59 $('report-error-link').onclick = function(e) { |
| 60 sendCommand('reportError'); |
| 61 }; |
| 59 $('see-more-link').onclick = function(e) { | 62 $('see-more-link').onclick = function(e) { |
| 60 seeMore(); | 63 seeMore(); |
| 61 // preventDefaultOnPoundLinkClicks doesn't work for this link since it | 64 // preventDefaultOnPoundLinkClicks doesn't work for this link since it |
| 62 // contains <span>s, which confuse preventDefaultOnPoundLinkClicks. | 65 // contains <span>s, which confuse preventDefaultOnPoundLinkClicks. |
| 63 e.preventDefault(); | 66 e.preventDefault(); |
| 64 }; | 67 }; |
| 65 $('check-report').onclick = savePreference; | 68 $('check-report').onclick = savePreference; |
| 66 | 69 |
| 67 // All the links are handled by javascript sending commands back to the C++ | 70 // All the links are handled by javascript sending commands back to the C++ |
| 68 // handler, we don't want the default actions. | 71 // handler, we don't want the default actions. |
| 69 preventDefaultOnPoundLinkClicks(); // From shared/js/util.js. | 72 preventDefaultOnPoundLinkClicks(); // From shared/js/util.js. |
| 70 }); | 73 }); |
| OLD | NEW |