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

Unified Diff: chrome/browser/resources/chromeos/drive_internals.js

Issue 10825062: gdata: Add Cache Contents section to chrome:drive-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/chromeos/drive_internals.js
diff --git a/chrome/browser/resources/chromeos/drive_internals.js b/chrome/browser/resources/chromeos/drive_internals.js
index fb9f8d3d063b3dc508b940192d1f1d6ab8f1d416..bdd522f7a261b90f10d11de576081e3b4b140f39 100644
--- a/chrome/browser/resources/chromeos/drive_internals.js
+++ b/chrome/browser/resources/chromeos/drive_internals.js
@@ -18,13 +18,6 @@ function updateAuthStatus(authStatus) {
*/
function updateGCacheContents(gcacheContents) {
var tbody = $('gcache-contents');
- // Add a header row.
- var tr = document.createElement('tr');
- tr.appendChild(createElementFromText('th', 'Path'));
- tr.appendChild(createElementFromText('th', 'Size'));
- tr.appendChild(createElementFromText('th', 'Last Modified'));
- tbody.appendChild(tr);
-
for (var i = 0; i < gcacheContents.length; i++) {
var entry = gcacheContents[i];
var tr = document.createElement('tr');
@@ -55,6 +48,24 @@ function updateFileSystemContents(directoryContentsAsText) {
}
/**
+ * Updates the Cache Contents section.
+ * @param {Object} cacheEntry Dictionary describing a cache entry.
+ * The function is called from the C++ side repeatedly.
+ */
+function updateCacheContents(cacheEntry) {
+ var tr = document.createElement('tr');
+ tr.appendChild(createElementFromText('td', cacheEntry.resource_id));
+ tr.appendChild(createElementFromText('td', cacheEntry.md5));
+ tr.appendChild(createElementFromText('td', cacheEntry.is_present));
+ tr.appendChild(createElementFromText('td', cacheEntry.is_pinned));
+ tr.appendChild(createElementFromText('td', cacheEntry.is_dirty));
+ tr.appendChild(createElementFromText('td', cacheEntry.is_mounted));
+ tr.appendChild(createElementFromText('td', cacheEntry.is_persistent));
+
+ $('cache-contents').appendChild(tr);
+}
+
+/**
* 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.
« no previous file with comments | « chrome/browser/resources/chromeos/drive_internals.html ('k') | chrome/browser/ui/webui/chromeos/drive_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698