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

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

Issue 2760753002: [CUPS] Implement the local CUPS printer setup waiting UI. (Closed)
Patch Set: . Created 3 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 unified diff | Download patch
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.
11 * @param {!cr.EventTarget} eventTarget Event target to pass to destination 11 * @param {!cr.EventTarget} eventTarget Event target to pass to destination
12 * items for dispatching SELECT events. 12 * items for dispatching SELECT events.
13 * @param {!print_preview.DestinationStore} Data store containing all the
14 * destinations.
13 * @constructor 15 * @constructor
14 * @extends {print_preview.DestinationList} 16 * @extends {print_preview.DestinationList}
15 */ 17 */
16 function RecentDestinationList(eventTarget) { 18 function RecentDestinationList(eventTarget, destinationStore) {
17 print_preview.DestinationList.call( 19 print_preview.DestinationList.call(
18 this, 20 this,
19 eventTarget, 21 eventTarget,
22 destinationStore,
20 loadTimeData.getString('recentDestinationsTitle'), 23 loadTimeData.getString('recentDestinationsTitle'),
21 null /*actionLinkLabel*/, 24 null /*actionLinkLabel*/,
22 true /*opt_showAll*/); 25 true /*opt_showAll*/);
23 }; 26 };
24 27
25 RecentDestinationList.prototype = { 28 RecentDestinationList.prototype = {
26 __proto__: print_preview.DestinationList.prototype, 29 __proto__: print_preview.DestinationList.prototype,
27 30
28 /** @override */ 31 /** @override */
29 updateShortListSize: function(size) { 32 updateShortListSize: function(size) {
30 this.setShortListSizeInternal( 33 this.setShortListSizeInternal(
31 Math.max(1, Math.min(size, this.getDestinationsCount()))); 34 Math.max(1, Math.min(size, this.getDestinationsCount())));
32 } 35 }
33 }; 36 };
34 37
35 return { 38 return {
36 RecentDestinationList: RecentDestinationList 39 RecentDestinationList: RecentDestinationList
37 }; 40 };
38 }); 41 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698