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

Side by Side Diff: chrome/browser/resources/sync_internals/data.js

Issue 134443004: sync: Remove some WebUI debug functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanups Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function() { 5 (function() {
6 var dumpToTextButton = $('dump-to-text'); 6 var dumpToTextButton = $('dump-to-text');
7 var dataDump = $('data-dump'); 7 var dataDump = $('data-dump');
8 dumpToTextButton.addEventListener('click', function(event) { 8 dumpToTextButton.addEventListener('click', function(event) {
9 // TODO(akalin): Add info like Chrome version, OS, date dumped, etc. 9 // TODO(akalin): Add info like Chrome version, OS, date dumped, etc.
10 10
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 var label = document.createElement('label'); 154 var label = document.createElement('label');
155 // Assigning to label.for doesn't work. 155 // Assigning to label.for doesn't work.
156 label.setAttribute('for', type); 156 label.setAttribute('for', type);
157 label.innerText = type; 157 label.innerText = type;
158 div.appendChild(label); 158 div.appendChild(label);
159 159
160 containerElt.appendChild(div); 160 containerElt.appendChild(div);
161 }); 161 });
162 } 162 }
163 163
164 function populateDatatypes(childNodeSummaries) {
165 var types = childNodeSummaries.map(function(n) {
166 return n.type;
167 });
168 types = types.sort();
169 createTypesCheckboxes(types);
170 }
171
172 document.addEventListener('DOMContentLoaded', function() { 164 document.addEventListener('DOMContentLoaded', function() {
173 chrome.sync.getRootNodeDetails(function(rootNode) { 165 chrome.sync.getListOfKnownTypes(function(types) {
174 chrome.sync.getChildNodeIds(rootNode.id, function(childNodeIds) { 166 types.sort();
175 chrome.sync.getNodeSummariesById(childNodeIds, populateDatatypes); 167 createTypesCheckboxes(types);
176 });
177 }); 168 });
178 }); 169 });
179 170
180 var dumpToFileLink = $('dump-to-file'); 171 var dumpToFileLink = $('dump-to-file');
181 dumpToFileLink.addEventListener('click', function(event) { 172 dumpToFileLink.addEventListener('click', function(event) {
182 chrome.sync.getAllNodes(triggerDataDownload); 173 chrome.sync.getAllNodes(triggerDataDownload);
183 }); 174 });
184 })(); 175 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698