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

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

Issue 209313002: Modified components ui to address concern of all the time disabled check update button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « chrome/browser/resources/components.html ('k') | chrome/browser/ui/webui/components_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/components.js
diff --git a/chrome/browser/resources/components.js b/chrome/browser/resources/components.js
index 8753e3192ab210b51c8f2d1ea813a50ca67c33bd..036fe5b3369dead2f3d650c3ca3f036a8d3646a0 100644
--- a/chrome/browser/resources/components.js
+++ b/chrome/browser/resources/components.js
@@ -14,8 +14,11 @@
function renderTemplate(componentsData) {
// This is the javascript code that processes the template:
var input = new JsEvalContext(componentsData);
- var output = $('componentTemplate');
+ var output = $('component-template').cloneNode(true);
+ $('component-placeholder').innerHTML = '';
+ $('component-placeholder').appendChild(output);
jstProcess(input, output);
+ output.removeAttribute('hidden');
}
/**
@@ -73,18 +76,30 @@ function returnComponentsData(componentsData) {
}
/**
+ * This event function is called from component UI indicating changed state
+ * of component updater service.
+ * @param {Object} eventArgs Contains event and component ID. Component ID is
+ * optional.
+ */
+function onComponentEvent(eventArgs) {
+ if (eventArgs['id']) {
+ var id = eventArgs['id'];
+ $('status-' + id).textContent = eventArgs['event'];
+ }
+}
+
+/**
* Handles an 'enable' or 'disable' button getting clicked.
* @param {HTMLElement} node The HTML element representing the component
* being checked for update.
*/
function handleCheckUpdate(node) {
- node.disabled = true;
+ $('status-' + String(node.id)).textContent =
+ loadTimeData.getString('checkingLabel');
+
// Tell the C++ ComponentssDOMHandler to check for update.
chrome.send('checkUpdate', [String(node.id)]);
}
// Get data and have it displayed upon loading.
document.addEventListener('DOMContentLoaded', requestComponentsData);
-
-// Add handlers to static HTML elements.
-$('button-check-update').onclick = handleCheckUpdate;
« no previous file with comments | « chrome/browser/resources/components.html ('k') | chrome/browser/ui/webui/components_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698