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

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

Issue 162283002: Move towards event-driven JS on about:sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another reupload 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 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 onReceivedListOfTypes(e) {
168 var types = e.details.types;
169 types.sort();
170 createTypesCheckboxes(types);
171 chrome.sync.events.removeEventListener(
172 'onReceivedListOfTypes',
173 onReceivedListOfTypes);
174 }
175
167 document.addEventListener('DOMContentLoaded', function() { 176 document.addEventListener('DOMContentLoaded', function() {
168 chrome.sync.getListOfTypes(function(types) { 177 chrome.sync.events.addEventListener(
169 types.sort(); 178 'onReceivedListOfTypes',
170 createTypesCheckboxes(types); 179 onReceivedListOfTypes);
171 }); 180 chrome.sync.requestListOfTypes();
172 }); 181 });
173 182
174 var dumpToFileLink = $('dump-to-file'); 183 var dumpToFileLink = $('dump-to-file');
175 dumpToFileLink.addEventListener('click', function(event) { 184 dumpToFileLink.addEventListener('click', function(event) {
176 chrome.sync.getAllNodes(triggerDataDownload); 185 chrome.sync.getAllNodes(triggerDataDownload);
177 }); 186 });
178 })(); 187 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/sync_internals/chrome_sync.js ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698