OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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 // Called by the common.js module. |
| 6 function moduleDidLoad() { |
| 7 // The module is not hidden by default so we can easily see if the plugin |
| 8 // failed to load. |
| 9 common.hideModule(); |
| 10 } |
| 11 |
| 12 // Called by the common.js module. |
| 13 function attachListeners() { |
| 14 document.getElementById('runthreadedtask').addEventListener('click', |
| 15 runthreadedtask); |
| 16 document.getElementById('sendasynctrace').addEventListener('click', |
| 17 sendasynctrace); |
| 18 } |
| 19 |
| 20 function runthreadedtask() { |
| 21 common.naclModule.postMessage('runthreadedtask'); |
| 22 } |
| 23 |
| 24 function sendasynctrace() { |
| 25 var async_button = document.getElementById('sendasynctrace'); |
| 26 if (async_button.value == 'Send trace begin') { |
| 27 common.naclModule.postMessage('sendasyncbegin'); |
| 28 async_button.value = 'Send trace end'; |
| 29 } else { |
| 30 common.naclModule.postMessage('sendasyncend'); |
| 31 async_button.value = 'Send trace begin'; |
| 32 } |
| 33 } |
| 34 |
| 35 // Called by the common.js module. |
| 36 function handleMessage(message_event) { |
| 37 } |
OLD | NEW |