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

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

Issue 10827292: Propagate the result of AmountOfFreeSpace to JS and show it in chrome://drive-internals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: style fixes, small improvements 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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 tr.appendChild(createElementFromText('td', cacheEntry.is_present)); 62 tr.appendChild(createElementFromText('td', cacheEntry.is_present));
63 tr.appendChild(createElementFromText('td', cacheEntry.is_pinned)); 63 tr.appendChild(createElementFromText('td', cacheEntry.is_pinned));
64 tr.appendChild(createElementFromText('td', cacheEntry.is_dirty)); 64 tr.appendChild(createElementFromText('td', cacheEntry.is_dirty));
65 tr.appendChild(createElementFromText('td', cacheEntry.is_mounted)); 65 tr.appendChild(createElementFromText('td', cacheEntry.is_mounted));
66 tr.appendChild(createElementFromText('td', cacheEntry.is_persistent)); 66 tr.appendChild(createElementFromText('td', cacheEntry.is_persistent));
67 67
68 $('cache-contents').appendChild(tr); 68 $('cache-contents').appendChild(tr);
69 } 69 }
70 70
71 /** 71 /**
72 * Updates the Local Storage summary.
73 * @param {Object} localStorageSummary Dictionaty describing the status of local
74 * stogage.
75 */
76 function updateLocalStorageUsage(localStorageSummary) {
77 var freeSpaceInMB = localStorageSummary.free_space / (1 << 20);
78 $('local-storage-freespace').innerText = freeSpaceInMB;
79 }
80
81 /**
72 * Creates an element named |elementName| containing the content |text|. 82 * Creates an element named |elementName| containing the content |text|.
73 * @param {string} elementName Name of the new element to be created. 83 * @param {string} elementName Name of the new element to be created.
74 * @param {string} text Text to be contained in the new element. 84 * @param {string} text Text to be contained in the new element.
75 * @return {HTMLElement} The newly created HTML element. 85 * @return {HTMLElement} The newly created HTML element.
76 */ 86 */
77 function createElementFromText(elementName, text) { 87 function createElementFromText(elementName, text) {
78 var element = document.createElement(elementName); 88 var element = document.createElement(elementName);
79 element.appendChild(document.createTextNode(text)); 89 element.appendChild(document.createTextNode(text));
80 return element; 90 return element;
81 } 91 }
82 92
83 document.addEventListener('DOMContentLoaded', function() { 93 document.addEventListener('DOMContentLoaded', function() {
84 chrome.send('pageLoaded'); 94 chrome.send('pageLoaded');
85 }); 95 });
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