Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 place_holder = $('local-storage-usage'); | |
|
satorux1
2012/08/13 07:26:20
placeHolder
Haruki Sato
2012/08/17 05:46:34
Done. Actually, I ended up removing this temporal
| |
| 78 | |
| 79 var freeSpaceDesc = localStorageSummary.free_space >= 0 ? | |
| 80 'Local free space: ' + localStorageSummary.free_space + ' bytes.' : | |
| 81 'Unable to check local free space.'; | |
|
satorux1
2012/08/13 07:26:20
chrome://drive-internals is for developers. The me
Haruki Sato
2012/08/17 05:46:34
Done.
and now it's so simple!
| |
| 82 place_holder.appendChild(createElementFromText('div', freeSpaceDesc)); | |
| 83 } | |
| 84 | |
| 85 /** | |
| 72 * Creates an element named |elementName| containing the content |text|. | 86 * Creates an element named |elementName| containing the content |text|. |
| 73 * @param {string} elementName Name of the new element to be created. | 87 * @param {string} elementName Name of the new element to be created. |
| 74 * @param {string} text Text to be contained in the new element. | 88 * @param {string} text Text to be contained in the new element. |
| 75 * @return {HTMLElement} The newly created HTML element. | 89 * @return {HTMLElement} The newly created HTML element. |
| 76 */ | 90 */ |
| 77 function createElementFromText(elementName, text) { | 91 function createElementFromText(elementName, text) { |
| 78 var element = document.createElement(elementName); | 92 var element = document.createElement(elementName); |
| 79 element.appendChild(document.createTextNode(text)); | 93 element.appendChild(document.createTextNode(text)); |
| 80 return element; | 94 return element; |
| 81 } | 95 } |
| 82 | 96 |
| 83 document.addEventListener('DOMContentLoaded', function() { | 97 document.addEventListener('DOMContentLoaded', function() { |
| 84 chrome.send('pageLoaded'); | 98 chrome.send('pageLoaded'); |
| 85 }); | 99 }); |
| OLD | NEW |