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.
9 * Takes the |moduleListData| input argument which represents data about
10 * the currently available modules and populates the html jstemplate
11 * with that data. It expects an object structure like the above.
12 * @param {Object} moduleListData Information about available modules
14 function renderTemplate(moduleListData) {
15 // Process the template.
16 var input = new JsEvalContext(moduleListData);
17 var output = $('naclInfoTemplate');
18 jstProcess(input, output);
22 * Asks the C++ NaClUIDOMHandler to get details about the NaCl and return
23 * the data in returnNaClInfo() (below).
25 function requestNaClInfo() {
26 chrome.send('requestNaClInfo');
30 * Called by the WebUI to re-populate the page with data representing the
31 * current state of NaCl.
32 * @param {Object} moduleListData Information about available modules
34 nacl.returnNaClInfo = function(moduleListData) {
35 $('loading-message').hidden = 'hidden';
36 $('body-container').hidden = '';
37 renderTemplate(moduleListData);
40 // Get data and have it displayed upon loading.
41 document.addEventListener('DOMContentLoaded', requestNaClInfo);