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

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

Issue 160083002: Refactor about:sync's events framework (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add semicolons 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // require: cr.js 5 // require: cr.js
6 6
7 cr.define('chrome.sync', function() { 7 cr.define('chrome.sync', function() {
8 var currSearchId = 0; 8 var currSearchId = 0;
9 9
10 var setQueryString = function(queryControl, query) { 10 var setQueryString = function(queryControl, query) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 statusControl.textContent = 'Searching for ' + query + '...'; 90 statusControl.textContent = 'Searching for ' + query + '...';
91 queryControl.removeAttribute('error'); 91 queryControl.removeAttribute('error');
92 var timer = chrome.sync.makeTimer(); 92 var timer = chrome.sync.makeTimer();
93 doSearch(query, function(nodes, error) { 93 doSearch(query, function(nodes, error) {
94 if (error) { 94 if (error) {
95 statusControl.textContent = 'Error: ' + error; 95 statusControl.textContent = 'Error: ' + error;
96 queryControl.setAttribute('error', ''); 96 queryControl.setAttribute('error', '');
97 } else { 97 } else {
98 statusControl.textContent = 98 statusControl.textContent =
99 'Found ' + nodes.length + ' nodes in ' + 99 'Found ' + nodes.length + ' nodes in ' +
100 timer.elapsedSeconds + 's'; 100 timer.getElapsedSeconds() + 's';
101 queryControl.removeAttribute('error'); 101 queryControl.removeAttribute('error');
102 102
103 // TODO(akalin): Write a nicer list display. 103 // TODO(akalin): Write a nicer list display.
104 for (var i = 0; i < nodes.length; ++i) { 104 for (var i = 0; i < nodes.length; ++i) {
105 nodes[i].toString = function() { 105 nodes[i].toString = function() {
106 return this.NON_UNIQUE_NAME; 106 return this.NON_UNIQUE_NAME;
107 }; 107 };
108 } 108 }
109 resultsDataModel.push.apply(resultsDataModel, nodes); 109 resultsDataModel.push.apply(resultsDataModel, nodes);
110 // Workaround for http://crbug.com/83452 . 110 // Workaround for http://crbug.com/83452 .
(...skipping 17 matching lines...) Expand all
128 detailsControl.textContent = JSON.stringify(selected, null, 2); 128 detailsControl.textContent = JSON.stringify(selected, null, 2);
129 } 129 }
130 }); 130 });
131 } 131 }
132 132
133 return { 133 return {
134 decorateSearchControls: decorateSearchControls, 134 decorateSearchControls: decorateSearchControls,
135 decorateQuickQueryControls: decorateQuickQueryControls 135 decorateQuickQueryControls: decorateQuickQueryControls
136 }; 136 };
137 }); 137 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/sync_internals/sync_log.js ('k') | chrome/browser/ui/webui/sync_internals_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698