| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 /** | 118 /** |
| 119 * Updates the summary about account metadata. | 119 * Updates the summary about account metadata. |
| 120 * @param {Object} accountMetadata Dictionary describing account metadata. | 120 * @param {Object} accountMetadata Dictionary describing account metadata. |
| 121 */ | 121 */ |
| 122 function updateAccountMetadata(accountMetadata) { | 122 function updateAccountMetadata(accountMetadata) { |
| 123 var quotaTotalInMb = accountMetadata['account-quota-total'] / (1 << 20); | 123 var quotaTotalInMb = accountMetadata['account-quota-total'] / (1 << 20); |
| 124 var quotaUsedInMb = accountMetadata['account-quota-used'] / (1 << 20); | 124 var quotaUsedInMb = accountMetadata['account-quota-used'] / (1 << 20); |
| 125 | 125 |
| 126 $('account-quota-info').textContent = | 126 $('account-quota-info').textContent = |
| 127 quotaUsedInMb + ' / ' + quotaTotalInMb + ' (MB)'; | 127 quotaUsedInMb + ' / ' + quotaTotalInMb + ' (MB)'; |
| 128 $('account-largest-changestamp').textContent = | 128 $('account-largest-changestamp-remote').textContent = |
| 129 accountMetadata['account-largest-changestamp']; | 129 accountMetadata['account-largest-changestamp-remote']; |
| 130 $('account-largest-changestamp-local').textContent = |
| 131 accountMetadata['account-largest-changestamp-local']; |
| 130 | 132 |
| 131 var installedAppContainer = $('account-installed-apps'); | 133 var installedAppContainer = $('account-installed-apps'); |
| 132 for (var i = 0; i < accountMetadata['installed-apps'].length; i++) { | 134 for (var i = 0; i < accountMetadata['installed-apps'].length; i++) { |
| 133 var app = accountMetadata['installed-apps'][i]; | 135 var app = accountMetadata['installed-apps'][i]; |
| 134 var tr = document.createElement('tr'); | 136 var tr = document.createElement('tr'); |
| 135 tr.className = 'installed-app'; | 137 tr.className = 'installed-app'; |
| 136 tr.appendChild(createElementFromText('td', app.app_name)); | 138 tr.appendChild(createElementFromText('td', app.app_name)); |
| 137 tr.appendChild(createElementFromText('td', app.app_id)); | 139 tr.appendChild(createElementFromText('td', app.app_id)); |
| 138 tr.appendChild(createElementFromText('td', app.object_type)); | 140 tr.appendChild(createElementFromText('td', app.object_type)); |
| 139 tr.appendChild(createElementFromText('td', app.supports_create)); | 141 tr.appendChild(createElementFromText('td', app.supports_create)); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 153 element.appendChild(document.createTextNode(text)); | 155 element.appendChild(document.createTextNode(text)); |
| 154 return element; | 156 return element; |
| 155 } | 157 } |
| 156 | 158 |
| 157 document.addEventListener('DOMContentLoaded', function() { | 159 document.addEventListener('DOMContentLoaded', function() { |
| 158 chrome.send('pageLoaded'); | 160 chrome.send('pageLoaded'); |
| 159 window.setInterval(function() { | 161 window.setInterval(function() { |
| 160 chrome.send('periodicUpdate'); | 162 chrome.send('periodicUpdate'); |
| 161 }, 1000); | 163 }, 1000); |
| 162 }); | 164 }); |
| OLD | NEW |