OLD | NEW |
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 * @constructor | 13 * @constructor |
14 * @extends {print_preview.DestinationList} | 14 * @extends {print_preview.DestinationList} |
15 */ | 15 */ |
16 function RecentDestinationList(eventTarget) { | 16 function RecentDestinationList(eventTarget) { |
17 print_preview.DestinationList.call( | 17 print_preview.DestinationList.call( |
18 this, | 18 this, |
19 eventTarget, | 19 eventTarget, |
20 localStrings.getString('recentDestinationsTitle')); | 20 loadTimeData.getString('recentDestinationsTitle')); |
21 }; | 21 }; |
22 | 22 |
23 RecentDestinationList.prototype = { | 23 RecentDestinationList.prototype = { |
24 __proto__: print_preview.DestinationList.prototype, | 24 __proto__: print_preview.DestinationList.prototype, |
25 | 25 |
26 /** @override */ | 26 /** @override */ |
27 updateShortListSize: function(size) { | 27 updateShortListSize: function(size) { |
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 }, |
(...skipping 10 matching lines...) Expand all Loading... |
41 this.addChild(destListItem); | 41 this.addChild(destListItem); |
42 destListItem.render(this.getChildElement('.destination-list > ul')); | 42 destListItem.render(this.getChildElement('.destination-list > ul')); |
43 } | 43 } |
44 } | 44 } |
45 }; | 45 }; |
46 | 46 |
47 return { | 47 return { |
48 RecentDestinationList: RecentDestinationList | 48 RecentDestinationList: RecentDestinationList |
49 }; | 49 }; |
50 }); | 50 }); |
OLD | NEW |