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

Unified Diff: chrome/browser/resources/sync_internals/notifications.html

Issue 6531038: [Sync] Split up about:sync html files to be more manageable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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.html
diff --git a/chrome/browser/resources/sync_internals/notifications.html b/chrome/browser/resources/sync_internals/notifications.html
new file mode 100644
index 0000000000000000000000000000000000000000..67fc97b7a14a025de235888cbb434abab2a21518
--- /dev/null
+++ b/chrome/browser/resources/sync_internals/notifications.html
@@ -0,0 +1,56 @@
+<script>
+(function () {
+function updateNotificationsEnabledInfo(notificationsEnabled) {
+ var notificationsEnabledInfo =
+ document.getElementById('notificationsEnabledInfo');
+ jstProcess(
+ new JsEvalContext({ 'notificationsEnabled': notificationsEnabled }),
+ notificationsEnabledInfo);
+}
+
+function onLoad() {
+ chrome.sync.getNotificationState(updateNotificationsEnabledInfo);
+ chrome.sync.onSyncNotificationStateChange.addListener(
+ updateNotificationsEnabledInfo);
+
+ var notificationCounts = {};
+ chrome.sync.onSyncIncomingNotification.addListener(function(changedTypes) {
+ for (var i = 0; i < changedTypes.length; ++i) {
+ var changedType = changedTypes[i];
+ notificationCounts[changedType] = notificationCounts[changedType] || 0;
+ ++notificationCounts[changedType];
+ }
+
+ var infos = [];
+ for (var k in notificationCounts) {
+ var info = { 'modelType': k, 'notificationCount': notificationCounts[k] };
+ infos.push(info);
+ }
+
+ var notificationCountsInfo =
+ document.getElementById('notificationCountsInfo');
+ jstProcess(new JsEvalContext({ 'notificationCounts': infos }),
+ notificationCountsInfo);
+ });
+}
+
+document.addEventListener("DOMContentLoaded", onLoad, false);
+})();
+</script>
+
+<div class="desc"><h2> Notifications </h2></div>
+<p id='notificationsEnabledInfo'>
+ Enabled: <span jscontent='notificationsEnabled'></span>
+</p>
+
+<table class='list' id='notificationCountsInfo'>
+ <tr jsselect='notificationCounts'>
John Gregg 2011/02/17 20:49:38 nit: be consistent with naming your jst variables
+ <td class='name'>
+ <div jscontent='modelType'></div>
+ </td>
+ <td class='number'>
+ <div jscontent='notificationCount'></div>
+ </td>
+ </tr>
+</table>
+

Powered by Google App Engine
This is Rietveld 408576698