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

Side by Side Diff: chrome/browser/resources/chromeos/drive_internals.js

Issue 10821051: gdata: Add File System Contents section to chrome:drive-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Updates the Authentication Status section. 6 * Updates the Authentication Status section.
7 * @param {Object} authStatus Dictionary containing auth status. 7 * @param {Object} authStatus Dictionary containing auth status.
8 */ 8 */
9 function updateAuthStatus(authStatus) { 9 function updateAuthStatus(authStatus) {
10 $('has-refresh-token').textContent = authStatus['has-refresh-token']; 10 $('has-refresh-token').textContent = authStatus['has-refresh-token'];
(...skipping 26 matching lines...) Expand all
37 path += '@'; 37 path += '@';
38 38
39 tr.appendChild(createElementFromText('td', path)); 39 tr.appendChild(createElementFromText('td', path));
40 tr.appendChild(createElementFromText('td', entry.size)); 40 tr.appendChild(createElementFromText('td', entry.size));
41 tr.appendChild(createElementFromText('td', entry.last_modified)); 41 tr.appendChild(createElementFromText('td', entry.last_modified));
42 tbody.appendChild(tr); 42 tbody.appendChild(tr);
43 } 43 }
44 } 44 }
45 45
46 /** 46 /**
47 * Updates the File System Contents section. The function is called from the
48 * C++ side repeatedly with contents of a directory.
49 * @param {string} directoryContentsAsText Pre-formatted string representation
50 * of contents a directory in the file system.
51 */
52 function updateFileSystemContents(directoryContentsAsText) {
53 var div = $('file-system-contents');
54 div.appendChild(createElementFromText('pre', directoryContentsAsText));
55 }
56
57 /**
47 * Creates an element named |elementName| containing the content |text|. 58 * Creates an element named |elementName| containing the content |text|.
48 * @param {string} elementName Name of the new element to be created. 59 * @param {string} elementName Name of the new element to be created.
49 * @param {string} text Text to be contained in the new element. 60 * @param {string} text Text to be contained in the new element.
50 * @return {HTMLElement} The newly created HTML element. 61 * @return {HTMLElement} The newly created HTML element.
51 */ 62 */
52 function createElementFromText(elementName, text) { 63 function createElementFromText(elementName, text) {
53 var element = document.createElement(elementName); 64 var element = document.createElement(elementName);
54 element.appendChild(document.createTextNode(text)); 65 element.appendChild(document.createTextNode(text));
55 return element; 66 return element;
56 } 67 }
57 68
58 document.addEventListener('DOMContentLoaded', function() { 69 document.addEventListener('DOMContentLoaded', function() {
59 chrome.send('pageLoaded'); 70 chrome.send('pageLoaded');
60 }); 71 });
OLDNEW
« 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