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

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

Issue 2600683002: Run tools/clang-format-js on some of chrome/browser/resources/ (Closed)
Patch Set: hackhackhack Created 3 years, 11 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
index b5a2578ee3dcb0ab82f231285113efcca9d8bd02..add8c629939054ed1fc7245fa0a53fe4f0ee7d2f 100644
--- a/chrome/browser/resources/sync_file_system_internals/sync_service.js
+++ b/chrome/browser/resources/sync_file_system_internals/sync_service.js
@@ -6,91 +6,92 @@
* WebUI to monitor the Sync File System Service.
*/
var SyncService = (function() {
-'use strict';
+ 'use strict';
-var SyncService = {};
+ var SyncService = {};
-/**
- * Request Sync Service Status.
- */
-function getServiceStatus() {
- chrome.send('getServiceStatus');
-}
+ /**
+ * Request Sync Service Status.
+ */
+ function getServiceStatus() {
+ chrome.send('getServiceStatus');
+ }
-/**
- * Called when service status is initially retrieved or updated via events.
- * @param {string} Service status enum as a string.
- */
-SyncService.onGetServiceStatus = function(statusString) {
- $('service-status').textContent = statusString;
-}
+ /**
+ * Called when service status is initially retrieved or updated via events.
+ * @param {string} Service status enum as a string.
+ */
+ SyncService.onGetServiceStatus = function(statusString) {
+ $('service-status').textContent = statusString;
+ };
-/**
- * Request Google Drive Notification Source. e.g. XMPP or polling.
- */
-function getNotificationSource() {
- chrome.send('getNotificationSource');
-}
+ /**
+ * Request Google Drive Notification Source. e.g. XMPP or polling.
+ */
+ function getNotificationSource() {
+ chrome.send('getNotificationSource');
+ }
-/**
- * Handles callback from getNotificationSource.
- * @param {string} Notification source as a string.
- */
-SyncService.onGetNotificationSource = function(sourceString) {
- $('notification-source').textContent = sourceString;
-}
+ /**
+ * Handles callback from getNotificationSource.
+ * @param {string} Notification source as a string.
+ */
+ SyncService.onGetNotificationSource = function(sourceString) {
+ $('notification-source').textContent = sourceString;
+ };
-// Keeps track of the last log event seen so it's not reprinted.
-var lastLogEventId = -1;
+ // Keeps track of the last log event seen so it's not reprinted.
+ var lastLogEventId = -1;
-/**
- * Request debug log.
- */
-function getLog() {
- chrome.send('getLog', [lastLogEventId]);
-}
+ /**
+ * Request debug log.
+ */
+ function getLog() {
+ chrome.send('getLog', [lastLogEventId]);
+ }
-/**
- * Clear old logs.
- */
-function clearLogs() {
- chrome.send('clearLogs');
- $('log-entries').innerHTML = '';
-}
+ /**
+ * Clear old logs.
+ */
+ function clearLogs() {
+ chrome.send('clearLogs');
+ $('log-entries').innerHTML = '';
+ }
-/**
- * Handles callback from getUpdateLog.
- * @param {Array} list List of dictionaries containing 'id', 'time', 'logEvent'.
- */
-SyncService.onGetLog = function(logEntries) {
- var itemContainer = $('log-entries');
- for (var i = 0; i < logEntries.length; i++) {
- var logEntry = logEntries[i];
- var tr = document.createElement('tr');
- var error = /ERROR/.test(logEntry.logEvent) ? ' error' : '';
- tr.appendChild(createElementFromText('td', logEntry.time,
- {'class': 'log-time'}));
- tr.appendChild(createElementFromText('td', logEntry.logEvent,
- {'class': 'log-event' + error}));
- itemContainer.appendChild(tr);
+ /**
+ * Handles callback from getUpdateLog.
+ * @param {Array} list List of dictionaries containing 'id', 'time',
+ * 'logEvent'.
+ */
+ SyncService.onGetLog = function(logEntries) {
+ var itemContainer = $('log-entries');
+ for (var i = 0; i < logEntries.length; i++) {
+ var logEntry = logEntries[i];
+ var tr = document.createElement('tr');
+ var error = /ERROR/.test(logEntry.logEvent) ? ' error' : '';
+ tr.appendChild(
+ createElementFromText('td', logEntry.time, {'class': 'log-time'}));
+ tr.appendChild(createElementFromText(
+ 'td', logEntry.logEvent, {'class': 'log-event' + error}));
+ itemContainer.appendChild(tr);
- lastLogEventId = logEntry.id;
- }
-}
+ lastLogEventId = logEntry.id;
+ }
+ };
-/**
- * Get initial sync service values and set listeners to get updated values.
- */
-function main() {
- cr.ui.decorate('tabbox', cr.ui.TabBox);
- $('clear-log-button').addEventListener('click', clearLogs);
- getServiceStatus();
- getNotificationSource();
+ /**
+ * Get initial sync service values and set listeners to get updated values.
+ */
+ function main() {
+ cr.ui.decorate('tabbox', cr.ui.TabBox);
+ $('clear-log-button').addEventListener('click', clearLogs);
+ getServiceStatus();
+ getNotificationSource();
- // TODO: Look for a way to push entries to the page when necessary.
- window.setInterval(getLog, 1000);
-}
+ // TODO: Look for a way to push entries to the page when necessary.
+ window.setInterval(getLog, 1000);
+ }
-document.addEventListener('DOMContentLoaded', main);
-return SyncService;
+ document.addEventListener('DOMContentLoaded', main);
+ return SyncService;
})();

Powered by Google App Engine
This is Rietveld 408576698