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

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: Rebase 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 var label = document.createElement('label'); 157 var label = document.createElement('label');
158 // Assigning to label.for doesn't work. 158 // Assigning to label.for doesn't work.
159 label.setAttribute('for', type); 159 label.setAttribute('for', type);
160 label.innerText = type; 160 label.innerText = type;
161 div.appendChild(label); 161 div.appendChild(label);
162 162
163 containerElt.appendChild(div); 163 containerElt.appendChild(div);
164 }); 164 });
165 } 165 }
166 166
167 function populateDatatypes(childNodeSummaries) {
168 var types = childNodeSummaries.map(function(n) {
169 return n.type;
170 });
171 types = types.sort();
172 createTypesCheckboxes(types);
173 }
174
175 document.addEventListener('DOMContentLoaded', function() { 167 document.addEventListener('DOMContentLoaded', function() {
176 chrome.sync.getRootNodeDetails(function(rootNode) { 168 chrome.sync.getListOfTypes(function(types) {
177 chrome.sync.getChildNodeIds(rootNode.id, function(childNodeIds) { 169 types.sort();
178 chrome.sync.getNodeSummariesById(childNodeIds, populateDatatypes); 170 createTypesCheckboxes(types);
179 });
180 }); 171 });
181 }); 172 });
182 173
183 var dumpToFileLink = $('dump-to-file'); 174 var dumpToFileLink = $('dump-to-file');
184 dumpToFileLink.addEventListener('click', function(event) { 175 dumpToFileLink.addEventListener('click', function(event) {
185 chrome.sync.getAllNodes(triggerDataDownload); 176 chrome.sync.getAllNodes(triggerDataDownload);
186 }); 177 });
187 })(); 178 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/sync_internals/chrome_sync.js ('k') | chrome/browser/resources/sync_internals/node_browser.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698