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 26 matching lines...) Expand all Loading... |
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 }); |
OLD | NEW |