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

Side by Side Diff: chrome/browser/resources/md_bookmarks/list.js

Issue 2918683002: Roll closure compiler (Closed)
Patch Set: Redo because local branch got messed up Created 3 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/types.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Polymer({ 5 Polymer({
6 is: 'bookmarks-list', 6 is: 'bookmarks-list',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 * focus on incremental update. 66 * focus on incremental update.
67 * @param {Array<string>} newValue 67 * @param {Array<string>} newValue
68 * @param {Array<string>} oldValue 68 * @param {Array<string>} oldValue
69 */ 69 */
70 onDisplayedIdsChanged_: function(newValue, oldValue) { 70 onDisplayedIdsChanged_: function(newValue, oldValue) {
71 if (!oldValue) { 71 if (!oldValue) {
72 this.displayedList_ = this.displayedIds_.map(function(id) { 72 this.displayedList_ = this.displayedIds_.map(function(id) {
73 return {id: id}; 73 return {id: id};
74 }); 74 });
75 } else { 75 } else {
76 var splices = Polymer.ArraySplice.calculateSplices(newValue, oldValue); 76 var splices = Polymer.ArraySplice.calculateSplices(
77 /** @type {!Array<string>} */ (newValue),
78 /** @type {!Array<string>} */ (oldValue));
77 splices.forEach(function(splice) { 79 splices.forEach(function(splice) {
78 // TODO(calamity): Could use notifySplices to improve performance here. 80 // TODO(calamity): Could use notifySplices to improve performance here.
79 var additions = 81 var additions =
80 newValue.slice(splice.index, splice.index + splice.addedCount) 82 newValue.slice(splice.index, splice.index + splice.addedCount)
81 .map(function(id) { 83 .map(function(id) {
82 return {id: id}; 84 return {id: id};
83 }); 85 });
84 this.splice.apply(this, [ 86 this.splice.apply(this, [
85 'displayedList_', splice.index, splice.removed.length 87 'displayedList_', splice.index, splice.removed.length
86 ].concat(additions)); 88 ].concat(additions));
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 176
175 this.dispatch(bookmarks.actions.selectItem( 177 this.dispatch(bookmarks.actions.selectItem(
176 this.displayedIds_[focusedIndex], this.getState(), config)); 178 this.displayedIds_[focusedIndex], this.getState(), config));
177 } 179 }
178 } 180 }
179 181
180 if (handled) 182 if (handled)
181 e.stopPropagation(); 183 e.stopPropagation();
182 }, 184 },
183 }); 185 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/types.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698