Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2039)

Unified Diff: chrome/browser/resources/about_nacl.js

Issue 10823214: Add a chrome://nacl page to show if NaCl is enabled and if PNaCl is installed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review, copyright, etc. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/about_nacl.js
diff --git a/chrome/browser/resources/about_nacl.js b/chrome/browser/resources/about_nacl.js
new file mode 100644
index 0000000000000000000000000000000000000000..f0265e8820d85420308c75fd9a657f31fc7ea940
--- /dev/null
+++ b/chrome/browser/resources/about_nacl.js
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var nacl = nacl || {};
+
+(function() {
+ /**
+ * Takes the |moduleListData| input argument which represents data about
+ * the currently available modules and populates the html jstemplate
+ * with that data. It expects an object structure like the above.
+ * @param {Object} moduleListData Information about available modules
+ */
+ function renderTemplate(moduleListData) {
+ // Process the template.
+ var input = new JsEvalContext(moduleListData);
+ var output = $('naclInfoTemplate');
+ jstProcess(input, output);
+ };
+
+ /**
+ * Asks the C++ NaClUIDOMHandler to get details about the NaCl and return
+ * the data in returnNaClInfo() (below).
+ */
+ function requestNaClInfo() {
+ chrome.send('requestNaClInfo');
+ };
+
+ /**
+ * Called by the WebUI to re-populate the page with data representing the
+ * current state of NaCl.
+ * @param {Object} moduleListData Information about available modules
+ */
+ nacl.returnNaClInfo = function(moduleListData) {
+ $('loading-message').hidden = 'hidden';
+ $('body-container').hidden = '';
+ renderTemplate(moduleListData);
+ };
+
+ // Get data and have it displayed upon loading.
+ document.addEventListener('DOMContentLoaded', requestNaClInfo);
+})();
« no previous file with comments | « chrome/browser/resources/about_nacl.html ('k') | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698