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 3// found in the LICENSE file. 4 5// Called by the common.js module. 6function moduleDidLoad() { 7 common.naclModule.style.backgroundColor = 'gray'; 8} 9 10// Called by the common.js module. 11function attachListeners() { 12 document.getElementById('killButton').addEventListener('click', cancelQueue); 13} 14 15// Called by the common.js module. 16function handleMessage(message) { 17 common.logMessage(message.data); 18} 19 20function cancelQueue() { 21 if (common.naclModule == null) { 22 console.log('Module is not loaded.'); 23 return; 24 } 25 common.naclModule.postMessage('CANCEL'); 26} 27