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

Unified Diff: components/sync_driver/resources/types.js

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. Created 4 years, 4 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
« no previous file with comments | « components/sync_driver/resources/types.html ('k') | components/sync_driver/shared_change_processor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/resources/types.js
diff --git a/components/sync_driver/resources/types.js b/components/sync_driver/resources/types.js
deleted file mode 100644
index d08cc0ed775920f6d56d9df3618b30f4f8bf8a0f..0000000000000000000000000000000000000000
--- a/components/sync_driver/resources/types.js
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-cr.define('chrome.sync.types', function() {
- var typeCountersMap = {};
-
- /**
- * Redraws the counters table taking advantage of the most recent
- * available information.
- *
- * Makes use of typeCountersMap, which is defined in the containing scope.
- */
- var refreshTypeCountersDisplay = function() {
- var typeCountersArray = [];
-
- // Transform our map into an array to make jstemplate happy.
- Object.keys(typeCountersMap).sort().forEach(function(t) {
- typeCountersArray.push({
- type: t,
- counters: typeCountersMap[t],
- });
- });
-
- jstProcess(
- new JsEvalContext({ rows: typeCountersArray }),
- $('type-counters-table'));
- };
-
- /**
- * Helps to initialize the table by picking up where initTypeCounters() left
- * off. That function registers this listener and requests that this event
- * be emitted.
- *
- * @param {!Object} e An event containing the list of known sync types.
- */
- var onReceivedListOfTypes = function(e) {
- var types = e.details.types;
- types.map(function(type) {
- if (!typeCountersMap.hasOwnProperty(type)) {
- typeCountersMap[type] = {};
- }
- });
- chrome.sync.events.removeEventListener(
- 'onReceivedListOfTypes',
- onReceivedListOfTypes);
- refreshTypeCountersDisplay();
- };
-
- /**
- * Callback for receipt of updated per-type counters.
- *
- * @param {!Object} e An event containing an updated counter.
- */
- var onCountersUpdated = function(e) {
- var details = e.details;
-
- var modelType = details.modelType;
- var counters = details.counters;
-
- if (typeCountersMap.hasOwnProperty(modelType))
- for (k in counters) {
- typeCountersMap[modelType][k] = counters[k];
- }
- refreshTypeCountersDisplay();
- };
-
- /**
- * Initializes state and callbacks for the per-type counters and status UI.
- */
- var initTypeCounters = function() {
- chrome.sync.events.addEventListener(
- 'onCountersUpdated',
- onCountersUpdated);
- chrome.sync.events.addEventListener(
- 'onReceivedListOfTypes',
- onReceivedListOfTypes);
-
- chrome.sync.requestListOfTypes();
- chrome.sync.registerForPerTypeCounters();
- };
-
- var onLoad = function() {
- initTypeCounters();
- };
-
- return {
- onLoad: onLoad
- };
-});
-
-document.addEventListener('DOMContentLoaded', chrome.sync.types.onLoad, false);
« no previous file with comments | « components/sync_driver/resources/types.html ('k') | components/sync_driver/shared_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698