Chromium Code Reviews| Index: chrome/browser/resources/sync_file_system_internals/sync_service.js |
| diff --git a/chrome/browser/resources/sync_file_system_internals/sync_service.js b/chrome/browser/resources/sync_file_system_internals/sync_service.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..656ff58948195eeb54e01ee990a457160cfa19d6 |
| --- /dev/null |
| +++ b/chrome/browser/resources/sync_file_system_internals/sync_service.js |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** |
| + * WebUI to monitor the Sync File System Service. |
| + */ |
| +var syncService = (function() { |
| +'use strict'; |
| + |
| +/** |
| + * Request Sync Service Status. |
| + * Asynchronous, result via getServiceStatusResult. |
| + */ |
| +function getServiceStatus() { |
| + chrome.send('getServiceStatus'); |
| +} |
| + |
| +/** |
| + * Handles callback from getServiceStatus. |
| + * @param {string} Service status enum as a string. |
| + */ |
| +function getServiceStatusResult(status_string) { |
| + console.log('getServiceStatusResult', status_string); |
| + $('service-status').innerHTML = status_string; |
|
tzik
2013/05/02 11:47:56
Can be innerText instead?
calvinlo
2013/05/02 11:51:55
Done.
|
| +} |
| + |
| +/** |
| + * Get initial sync service values and set listeners to get updated values. |
| + */ |
| +function main() { |
| + cr.ui.decorate('tabbox', cr.ui.TabBox); |
| + getServiceStatus(); |
| +} |
| + |
| +return { |
| + main: main, |
| + getServiceStatusResult: getServiceStatusResult |
| +}; |
| + |
| +})(); |
| + |
| +document.addEventListener('DOMContentLoaded', syncService.main); |