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

Unified Diff: chrome/browser/resources/sync_internals/notifications.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
Index: chrome/browser/resources/sync_internals/notifications.js
diff --git a/chrome/browser/resources/sync_internals/notifications.js b/chrome/browser/resources/sync_internals/notifications.js
index af6cb3f59e7053725ea3faadf96104e31e94623e..b355fb45027223b310644e31d7ad7d5fb8c29d9f 100644
--- a/chrome/browser/resources/sync_internals/notifications.js
+++ b/chrome/browser/resources/sync_internals/notifications.js
@@ -78,11 +78,15 @@ function updateNotificationInfo(notificationInfo) {
function onLoad() {
chrome.sync.getNotificationState(updateNotificationStateInfo);
chrome.sync.getNotificationInfo(updateNotificationInfo);
- chrome.sync.onNotificationStateChange.addListener(
- function(details) { updateNotificationStateInfo(details.state); });
- chrome.sync.onIncomingNotification.addListener(function(details) {
- var changedTypes = details.changedTypes;
+ chrome.sync.events.addEventListener(
+ 'onNotificationStateChange',
+ function(e) {
+ updateNotificationStateInfo(e.details.state);
+ });
+
+ chrome.sync.events.addEventListener('onIncomingNotification', function(e) {
+ var changedTypes = e.details.changedTypes;
for (var i = 0; i < changedTypes.length; ++i) {
incrementSessionNotificationCount(changedTypes[i]);
}
« no previous file with comments | « chrome/browser/resources/sync_internals/chrome_sync.js ('k') | chrome/browser/resources/sync_internals/sync_log.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698