Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: chrome/browser/resources/sync_file_system_internals/sync_service.js

Issue 14765003: Gets the initial sync service status. In the next patch I'll make the syncfs-internals dashboard a … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tzik review #1 Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..a21fb61c1e2e09ea9cf68be5e307a315dbaaa1f9
--- /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) {
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.
+ console.log('getServiceStatusResult', status_string);
+ $('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.
+}
+
+/**
+ * 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);
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.

Powered by Google App Engine
This is Rietveld 408576698