Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / print_preview / search / recent_destination_list.js
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
3 // found in the LICENSE file.
4
5 cr.define('print_preview', function() {
6   'use strict';
7
8   /**
9    * Sub-class of a destination list that shows recent destinations. This list
10    * does not render a "Show all" button.
11    * @param {!cr.EventTarget} eventTarget Event target to pass to destination
12    *     items for dispatching SELECT events.
13    * @constructor
14    * @extends {print_preview.DestinationList}
15    */
16   function RecentDestinationList(eventTarget) {
17     print_preview.DestinationList.call(
18         this,
19         eventTarget,
20         loadTimeData.getString('recentDestinationsTitle'),
21         null /*actionLinkLabel*/,
22         true /*opt_showAll*/);
23   };
24
25   RecentDestinationList.prototype = {
26     __proto__: print_preview.DestinationList.prototype,
27
28     /** @override */
29     updateShortListSize: function(size) {
30       this.setShortListSizeInternal(
31           Math.max(1, Math.min(size, this.getDestinationsCount())));
32     }
33   };
34
35   return {
36     RecentDestinationList: RecentDestinationList
37   };
38 });