summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/sync_internals/sync_index.html
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/resources/sync_internals/sync_index.html')
-rw-r--r--chrome/browser/resources/sync_internals/sync_index.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/chrome/browser/resources/sync_internals/sync_index.html b/chrome/browser/resources/sync_internals/sync_index.html
index 26ed19e..51e397d 100644
--- a/chrome/browser/resources/sync_internals/sync_index.html
+++ b/chrome/browser/resources/sync_internals/sync_index.html
@@ -7,6 +7,7 @@ chrome/test/functional/special_tabs.py. -->
<script>
function onLoad() {
chrome.send('getAboutInfo');
+ chrome.send('getNotificationState');
}
function onGetAboutInfoFinished(aboutInfo) {
@@ -14,9 +15,42 @@ function onGetAboutInfoFinished(aboutInfo) {
jstProcess(new JsEvalContext(aboutInfo), aboutInfoDiv);
}
+function onGetNotificationStateFinished(notificationsEnabled) {
+ onSyncNotificationStateChange(notificationsEnabled);
+}
+
function onSyncServiceStateChanged() {
chrome.send('getAboutInfo');
}
+
+function onSyncNotificationStateChange(notificationsEnabled) {
+ var notificationsEnabledInfo =
+ document.getElementById('notificationsEnabledInfo');
+ jstProcess(
+ new JsEvalContext({ 'notificationsEnabled': notificationsEnabled }),
+ notificationsEnabledInfo);
+}
+
+var notificationCounts = {};
+
+function onSyncIncomingNotification(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);
+}
</script>
<style type="text/css">
@@ -223,5 +257,22 @@ table.list#details .name {
</div>
</div>
+<div class="desc"><h2> Notifications </h2></div>
+<p id='notificationsEnabledInfo'>
+ Enabled: <span jscontent='notificationsEnabled'></span>
+</p>
+
+<table class='list' id='notificationCountsInfo'>
+ <tr jsselect='notificationCounts'>
+ <td class='name'>
+ <div jscontent='modelType'></div>
+ </td>
+ <td class='number'>
+ <div jscontent='notificationCount'></div>
+ </td>
+ </tr>
+</table>
+</td>
+
</body>
</html>