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

Unified Diff: chrome/browser/resources/sync_internals/chrome_sync.js

Issue 162283002: Move towards event-driven JS on about:sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another reupload Created 6 years, 10 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
« no previous file with comments | « chrome/browser/resources/sync_internals/about.js ('k') | chrome/browser/resources/sync_internals/data.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/sync_internals/chrome_sync.js
diff --git a/chrome/browser/resources/sync_internals/chrome_sync.js b/chrome/browser/resources/sync_internals/chrome_sync.js
index eb08bbefc470c4b4a8754089279e35d07578e95b..e6247392a2b0a63d886ce65ef71b6e7b47d1512a 100644
--- a/chrome/browser/resources/sync_internals/chrome_sync.js
+++ b/chrome/browser/resources/sync_internals/chrome_sync.js
@@ -4,7 +4,7 @@
// require cr.js
// require cr/event_target.js
-// requier cr/util.js
+// require cr/util.js
cr.define('chrome.sync', function() {
'use strict';
@@ -34,17 +34,11 @@ cr.define('chrome.sync', function() {
}
var syncFunctions = [
- // Sync service functions.
- 'getAboutInfo',
-
// Notification functions. See chrome/browser/sync/engine/syncapi.h
// for docs.
'getNotificationState',
'getNotificationInfo',
- // Get a static list of available data types.
- 'getListOfTypes',
-
// Client server communication logging functions.
'getClientServerTraffic',
@@ -93,9 +87,28 @@ cr.define('chrome.sync', function() {
chrome.sync.events.dispatchEvent(e);
};
+ /**
+ * Asks the browser to refresh our snapshot of sync state. Should result
+ * in an onAboutInfoUpdated event being emitted.
+ */
+ var requestUpdatedAboutInfo = function() {
+ chrome.send('requestUpdatedAboutInfo');
+ };
+
+ /**
+ * Asks the browser to send us the list of registered types. Should result
+ * in an onReceivedListOfTypes event being emitted.
+ */
+ var requestListOfTypes = function() {
+ chrome.send('requestListOfTypes');
+ };
+
return {
makeTimer: makeTimer,
dispatchEvent: dispatchEvent,
events: new cr.EventTarget(),
+
+ requestUpdatedAboutInfo: requestUpdatedAboutInfo,
+ requestListOfTypes: requestListOfTypes,
};
});
« no previous file with comments | « chrome/browser/resources/sync_internals/about.js ('k') | chrome/browser/resources/sync_internals/data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698