OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 var expandedDetails = false; |
| 6 var keyPressState = 0; |
| 7 |
| 8 /* |
| 9 * A convenience method for sending commands to the parent page. |
| 10 * @param {string} cmd The command to send. |
| 11 */ |
| 12 function sendCommand(cmd) { |
| 13 window.domAutomationController.setAutomationId(1); |
| 14 window.domAutomationController.send(cmd); |
| 15 } |
| 16 |
| 17 function setupEvents() { |
| 18 $('primary-button').addEventListener('click', function() { |
| 19 sendCommand(DRP_CMD_TAKE_ME_BACK); |
| 20 }); |
| 21 |
| 22 $('secondary-button').addEventListener('click', function() { |
| 23 sendCommand(DRP_CMD_PROCEED); |
| 24 }); |
| 25 |
| 26 preventDefaultOnPoundLinkClicks(); |
| 27 } |
| 28 |
| 29 document.addEventListener('DOMContentLoaded', setupEvents); |
OLD | NEW |