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

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

Issue 7055023: [Sync] Implement search frontend in chrome://sync-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: diff against right branch Created 9 years, 7 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_node_browser.js
diff --git a/chrome/browser/resources/sync_internals/sync_node_browser.js b/chrome/browser/resources/sync_internals/sync_node_browser.js
index 3ce44697e01b8178c190c762c0ea0bce149b5a10..431acabcca45e554207c0c9dbf3922c3418e2c9e 100644
--- a/chrome/browser/resources/sync_internals/sync_node_browser.js
+++ b/chrome/browser/resources/sync_internals/sync_node_browser.js
@@ -7,33 +7,6 @@
// require: cr/ui/tree.js
cr.define('chrome.sync', function() {
- // Allow platform specific CSS rules.
- //
- // TODO(akalin): BMM and options page does something similar, too.
- // Move this to util.js.
- if (cr.isWindows)
- document.documentElement.setAttribute('os', 'win');
-
- // TODO(akalin): Create SyncNodeTree/SyncNodeTreeItem classes that
- // hide all these details.
-
- /**
- * Returns an object which measures elapsed time.
- */
- var makeTimer = function() {
- var start = new Date();
-
- return {
- /**
- * @return {number} The number of seconds since the timer was
- * created.
- */
- get elapsedSeconds() {
- return ((new Date()).getTime() - start.getTime()) / 1000.0;
- }
- };
- };
-
/**
* Gets all children of the given node and passes it to the given
* callback.
@@ -43,12 +16,12 @@ cr.define('chrome.sync', function() {
* children.
*/
function getSyncNodeChildren(nodeInfo, callback) {
- var timer = makeTimer();
+ var timer = chrome.sync.makeTimer();
chrome.sync.getChildNodeIds(nodeInfo.id, function(childNodeIds) {
console.debug('getChildNodeIds took ' +
timer.elapsedSeconds + 's to retrieve ' +
childNodeIds.length + ' ids');
- timer = makeTimer();
+ timer = chrome.sync.makeTimer();
chrome.sync.getNodesById(childNodeIds, function(children) {
console.debug('getNodesById took ' +
timer.elapsedSeconds + 's to retrieve ' +
@@ -79,7 +52,7 @@ cr.define('chrome.sync', function() {
treeItem.addEventListener('expand', function(event) {
if (!treeItem.triggeredLoad_) {
getSyncNodeChildren(nodeInfo, function(children) {
- var timer = makeTimer();
+ var timer = chrome.sync.makeTimer();
for (var i = 0; i < children.length; ++i) {
var childTreeItem = makeNodeTreeItem(children[i]);
treeItem.add(childTreeItem);
« no previous file with comments | « chrome/browser/resources/sync_internals/sync_index.html ('k') | chrome/browser/resources/sync_internals/sync_search.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698