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 Drive related Flags section. | 6 * Updates the Drive related Flags section. |
7 * @param {Array} flags List of dictionaries describing flags. | 7 * @param {Array} flags List of dictionaries describing flags. |
8 */ | 8 */ |
9 function updateDriveRelatedFlags(flags) { | 9 function updateDriveRelatedFlags(flags) { |
10 var ul = $('drive-related-flags'); | 10 var ul = $('drive-related-flags'); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 tr.appendChild(createElementFromText('td', app.app_name)); | 158 tr.appendChild(createElementFromText('td', app.app_name)); |
159 tr.appendChild(createElementFromText('td', app.app_id)); | 159 tr.appendChild(createElementFromText('td', app.app_id)); |
160 tr.appendChild(createElementFromText('td', app.object_type)); | 160 tr.appendChild(createElementFromText('td', app.object_type)); |
161 tr.appendChild(createElementFromText('td', app.supports_create)); | 161 tr.appendChild(createElementFromText('td', app.supports_create)); |
162 | 162 |
163 installedAppContainer.appendChild(tr); | 163 installedAppContainer.appendChild(tr); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 /** | 167 /** |
| 168 * Updates the summary about delta update status. |
| 169 * @param {Object} deltaUpdateStatus Dictionary describing delta update status. |
| 170 */ |
| 171 function updateDeltaUpdateStatus(deltaUpdateStatus) { |
| 172 $('push-notification-enabled').textContent = |
| 173 deltaUpdateStatus['push-notification-enabled']; |
| 174 $('polling-interval-sec').textContent = |
| 175 deltaUpdateStatus['polling-interval-sec']; |
| 176 $('last-update-check-time').textContent = |
| 177 deltaUpdateStatus['last-update-check-time']; |
| 178 $('last-update-check-error').textContent = |
| 179 deltaUpdateStatus['last-update-check-error']; |
| 180 } |
| 181 |
| 182 /** |
168 * Creates an element named |elementName| containing the content |text|. | 183 * Creates an element named |elementName| containing the content |text|. |
169 * @param {string} elementName Name of the new element to be created. | 184 * @param {string} elementName Name of the new element to be created. |
170 * @param {string} text Text to be contained in the new element. | 185 * @param {string} text Text to be contained in the new element. |
171 * @return {HTMLElement} The newly created HTML element. | 186 * @return {HTMLElement} The newly created HTML element. |
172 */ | 187 */ |
173 function createElementFromText(elementName, text) { | 188 function createElementFromText(elementName, text) { |
174 var element = document.createElement(elementName); | 189 var element = document.createElement(elementName); |
175 element.appendChild(document.createTextNode(text)); | 190 element.appendChild(document.createTextNode(text)); |
176 return element; | 191 return element; |
177 } | 192 } |
(...skipping 27 matching lines...) Expand all Loading... |
205 a.href = '#' + section.id; | 220 a.href = '#' + section.id; |
206 var li = document.createElement('li'); | 221 var li = document.createElement('li'); |
207 li.appendChild(a); | 222 li.appendChild(a); |
208 toc.appendChild(li); | 223 toc.appendChild(li); |
209 } | 224 } |
210 | 225 |
211 window.setInterval(function() { | 226 window.setInterval(function() { |
212 chrome.send('periodicUpdate'); | 227 chrome.send('periodicUpdate'); |
213 }, 1000); | 228 }, 1000); |
214 }); | 229 }); |
OLD | NEW |