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 $('local-storage-freespace').innerText = localStorageSummary.free_space; | |
satorux1
2012/08/17 10:50:49
I guess we want to convert it to MB. Otherwise, th
Haruki Sato
2012/08/17 15:08:45
Done.
| |
78 } | |
79 | |
80 /** | |
72 * Creates an element named |elementName| containing the content |text|. | 81 * Creates an element named |elementName| containing the content |text|. |
73 * @param {string} elementName Name of the new element to be created. | 82 * @param {string} elementName Name of the new element to be created. |
74 * @param {string} text Text to be contained in the new element. | 83 * @param {string} text Text to be contained in the new element. |
75 * @return {HTMLElement} The newly created HTML element. | 84 * @return {HTMLElement} The newly created HTML element. |
76 */ | 85 */ |
77 function createElementFromText(elementName, text) { | 86 function createElementFromText(elementName, text) { |
78 var element = document.createElement(elementName); | 87 var element = document.createElement(elementName); |
79 element.appendChild(document.createTextNode(text)); | 88 element.appendChild(document.createTextNode(text)); |
80 return element; | 89 return element; |
81 } | 90 } |
82 | 91 |
83 document.addEventListener('DOMContentLoaded', function() { | 92 document.addEventListener('DOMContentLoaded', function() { |
84 chrome.send('pageLoaded'); | 93 chrome.send('pageLoaded'); |
85 }); | 94 }); |
OLD | NEW |