Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * WebUI to monitor the Sync File System Service. | |
| 7 */ | |
| 8 var syncService = (function() { | |
| 9 'use strict'; | |
| 10 | |
| 11 /** | |
| 12 * Request Sync Service Status. | |
| 13 * Asynchronous, result via getServiceStatusResult. | |
| 14 */ | |
| 15 function getServiceStatus() { | |
| 16 chrome.send('getServiceStatus'); | |
| 17 } | |
| 18 | |
| 19 /** | |
| 20 * Handles callback from getServiceStatus. | |
| 21 * @param {string} Service status enum as a string. | |
| 22 */ | |
| 23 function getServiceStatusResult(status_string) { | |
|
arv (Not doing code reviews)
2013/05/02 19:45:06
no underscores in js
calvinlo
2013/05/07 06:14:10
Done. Changed to camel case.
| |
| 24 console.log('getServiceStatusResult', status_string); | |
| 25 $('service-status').innerText = status_string; | |
|
arv (Not doing code reviews)
2013/05/02 19:45:06
textContent
calvinlo
2013/05/07 06:14:10
Done.
| |
| 26 } | |
| 27 | |
| 28 /** | |
| 29 * Get initial sync service values and set listeners to get updated values. | |
| 30 */ | |
| 31 function main() { | |
| 32 cr.ui.decorate('tabbox', cr.ui.TabBox); | |
| 33 getServiceStatus(); | |
| 34 } | |
| 35 | |
| 36 return { | |
| 37 main: main, | |
| 38 getServiceStatusResult: getServiceStatusResult | |
| 39 }; | |
| 40 | |
| 41 })(); | |
| 42 | |
| 43 document.addEventListener('DOMContentLoaded', syncService.main); | |
|
arv (Not doing code reviews)
2013/05/02 19:45:06
move into IIFE and skip syncService
document.addE
calvinlo
2013/05/07 06:14:10
Done.
| |
| OLD | NEW |