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

Unified Diff: chrome/browser/resources/sync_file_system_internals/extension_statuses.js

Issue 16398011: Show ExtensionID->OriginSyncStatus in syncfs-internals WebUI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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/sync_file_system_internals/extension_statuses.js
diff --git a/chrome/browser/resources/sync_file_system_internals/extension_statuses.js b/chrome/browser/resources/sync_file_system_internals/extension_statuses.js
new file mode 100644
index 0000000000000000000000000000000000000000..2b598f884fd16d03d313c36aa14552d01c33d1fd
--- /dev/null
+++ b/chrome/browser/resources/sync_file_system_internals/extension_statuses.js
@@ -0,0 +1,57 @@
+// Copyright 2013 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.
+
+/**
+ * WebUI to monitor the Sync File System Service.
+ */
+var extensionStatuses = (function() {
+'use strict';
+
+function extensionStatuses() {
+}
+
+/**
+ * Get initial map of extension statuses (pending batch sync, enabled and
+ * disabled).
+ */
+function getExtensionStatuses() {
+ chrome.send('getExtensionStatuses');
+}
+
+function main() {
+ getExtensionStatuses();
+}
+
+// TODO(calvinlo): Move to helper file so it doesn't need to be duplicated.
+/**
+ * Creates an element named |elementName| containing the content |text|.
+ * @param {string} elementName Name of the new element to be created.
+ * @param {string} text Text to be contained in the new element.
+ * @return {HTMLElement} The newly created HTML element.
+ */
+function createElementFromText(elementName, text) {
+ var element = document.createElement(elementName);
+ element.appendChild(document.createTextNode(text));
+ return element;
+}
+
+/**
+ * Handles callback from getUpdateLog.
+ * @param {Array} list List of dictionaries containing 'time' and 'logEvent'.
+ */
+extensionStatuses.prototype.onGetExtensionStatuses =
+ function(extensionStatuses) {
+ var itemContainer = $('extension-entries');
+ for (var i = 0; i < extensionStatuses.length; i++) {
+ var originEntry = extensionStatuses[i];
+ var tr = document.createElement('tr');
+ tr.appendChild(createElementFromText('td', originEntry.extensionID));
+ tr.appendChild(createElementFromText('td', originEntry.status));
+ itemContainer.appendChild(tr);
+ }
+}
+
+document.addEventListener('DOMContentLoaded', main);
+return new extensionStatuses;
+})();

Powered by Google App Engine
This is Rietveld 408576698