| 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(statusString) { | |
| 24 console.log('getServiceStatusResult', statusString); | |
| 25 $('service-status').textContent = statusString; | |
| 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 document.addEventListener('DOMContentLoaded', main); | |
| 37 | |
| 38 // Must export callbacks as they are called directly from C++ handler code. | |
| 39 return { | |
| 40 getServiceStatusResult: getServiceStatusResult | |
| 41 }; | |
| 42 })(); | |
| 43 | |
| OLD | NEW |