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

Unified Diff: chrome/browser/resources/sync_internals/sync_search.js

Issue 224563004: sync: Re-implement getAllNodes WebUI function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Many updates Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/sync_internals/sync_search.js
diff --git a/chrome/browser/resources/sync_internals/sync_search.js b/chrome/browser/resources/sync_internals/sync_search.js
index 7e3f3459fdad787ee181fe037ea53b4852839b25..ee1690b817a74d8b0c6eef132643ec9162183649 100644
--- a/chrome/browser/resources/sync_internals/sync_search.js
+++ b/chrome/browser/resources/sync_internals/sync_search.js
@@ -47,11 +47,16 @@ cr.define('chrome.sync', function() {
var searchId = ++currSearchId;
try {
var regex = new RegExp(query);
- chrome.sync.getAllNodes(query, function(allNodes) {
+ chrome.sync.getAllNodes(function(node_map) {
+ // Put all nodes into one big list that ignores the type.
+ var nodes = node_map
+ .map(function(x) { return x.nodes; })
Dan Beam 2014/04/05 00:19:25 . at end
rlarocque 2014/04/05 00:27:29 Done.
+ .reduce(function(a, b) { return a.concat(b); });
+
if (currSearchId != searchId) {
return;
}
- callback(allNodes.filter(function(elem) {
+ callback(nodes.filter(function(elem) {
return regex.test(JSON.stringify(elem, null, 2));
}), null);
});

Powered by Google App Engine
This is Rietveld 408576698