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

Side by Side Diff: chrome/browser/resources/print_preview/search/recent_destination_list.js

Issue 595423002: Take search query into account rendering recent destination list items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « chrome/browser/resources/print_preview/search/destination_list.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Sub-class of a destination list that shows recent destinations. This list 9 * Sub-class of a destination list that shows recent destinations. This list
10 * does not render a "Show all" button. 10 * does not render a "Show all" button.
(...skipping 17 matching lines...) Expand all
28 this.setShortListSizeInternal( 28 this.setShortListSizeInternal(
29 Math.max(1, Math.min(size, this.getDestinationsCount()))); 29 Math.max(1, Math.min(size, this.getDestinationsCount())));
30 }, 30 },
31 31
32 /** @override */ 32 /** @override */
33 renderListInternal: function(destinations) { 33 renderListInternal: function(destinations) {
34 setIsVisible(this.getChildElement('.no-destinations-message'), 34 setIsVisible(this.getChildElement('.no-destinations-message'),
35 destinations.length == 0); 35 destinations.length == 0);
36 setIsVisible(this.getChildElement('.destination-list > footer'), false); 36 setIsVisible(this.getChildElement('.destination-list > footer'), false);
37 var numItems = Math.min(destinations.length, this.shortListSize_); 37 var numItems = Math.min(destinations.length, this.shortListSize_);
38 for (var i = 0; i < numItems; i++) { 38 for (var i = 0; i < numItems; i++)
39 var destListItem = new print_preview.DestinationListItem( 39 this.renderListItemInternal(destinations[i]);
40 this.eventTarget_, destinations[i]);
41 this.addChild(destListItem);
42 destListItem.render(this.getChildElement('.destination-list > ul'));
43 }
44 } 40 }
45 }; 41 };
46 42
47 return { 43 return {
48 RecentDestinationList: RecentDestinationList 44 RecentDestinationList: RecentDestinationList
49 }; 45 };
50 }); 46 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/search/destination_list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698