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

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

Issue 160083002: Refactor about:sync's events framework (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add semicolons 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 | « no previous file | chrome/browser/resources/sync_internals/chrome_sync.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/sync_internals/about.js
diff --git a/chrome/browser/resources/sync_internals/about.js b/chrome/browser/resources/sync_internals/about.js
index d915fd77a1490047a503254fdd6396739e9e54df..7136b903431dbdb7f432ec6916df45c363407b54 100644
--- a/chrome/browser/resources/sync_internals/about.js
+++ b/chrome/browser/resources/sync_internals/about.js
@@ -34,9 +34,11 @@ function onLoad() {
$('status-data').hidden = true;
chrome.sync.getAboutInfo(refreshAboutInfo);
- chrome.sync.onServiceStateChanged.addListener(function() {
- chrome.sync.getAboutInfo(refreshAboutInfo);
- });
+ chrome.sync.events.addEventListener(
+ 'onServiceStateChanged',
+ function(e) {
+ chrome.sync.getAboutInfo(refreshAboutInfo);
+ });
var dumpStatusButton = $('dump-status');
dumpStatusButton.addEventListener('click', function(event) {
@@ -75,7 +77,9 @@ function onLoad() {
data = data.substr(firstBrace);
// Remove listeners to prevent sync events from overwriting imported data.
- chrome.sync.onServiceStateChanged.removeListeners();
+ chrome.sync.events.removeEventListener(
+ 'onServiceStateChanged',
+ refreshAboutInfo);
var aboutInfo = JSON.parse(data);
refreshAboutInfo(aboutInfo);
« no previous file with comments | « no previous file | chrome/browser/resources/sync_internals/chrome_sync.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698