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 cloud-based destinations. | 9 * Sub-class of a destination list that shows cloud-based destinations. |
10 * @param {!cr.EventTarget} eventTarget Event target to pass to destination | 10 * @param {!cr.EventTarget} eventTarget Event target to pass to destination |
11 * items for dispatching SELECT events. | 11 * items for dispatching SELECT events. |
12 * @constructor | 12 * @constructor |
13 * @extends {print_preview.DestinationList} | 13 * @extends {print_preview.DestinationList} |
14 */ | 14 */ |
15 function CloudDestinationList(eventTarget) { | 15 function CloudDestinationList(eventTarget) { |
16 print_preview.DestinationList.call( | 16 print_preview.DestinationList.call( |
17 this, | 17 this, eventTarget, loadTimeData.getString('cloudDestinationsTitle'), |
18 eventTarget, | |
19 loadTimeData.getString('cloudDestinationsTitle'), | |
20 loadTimeData.getString('manage')); | 18 loadTimeData.getString('manage')); |
21 } | 19 } |
22 | 20 |
23 CloudDestinationList.prototype = { | 21 CloudDestinationList.prototype = { |
24 __proto__: print_preview.DestinationList.prototype, | 22 __proto__: print_preview.DestinationList.prototype, |
25 | 23 |
26 /** @override */ | 24 /** @override */ |
27 updateDestinations: function(destinations) { | 25 updateDestinations: function(destinations) { |
28 // Change the action link from "Manage..." to "Setup..." if user only has | 26 // Change the action link from "Manage..." to "Setup..." if user only has |
29 // the Docs printer. | 27 // the Docs printer. |
30 var docsId = print_preview.Destination.GooglePromotedId.DOCS; | 28 var docsId = print_preview.Destination.GooglePromotedId.DOCS; |
31 this.setActionLinkTextInternal(loadTimeData.getString( | 29 this.setActionLinkTextInternal(loadTimeData.getString( |
32 destinations.length == 1 && destinations[0].id == docsId ? | 30 destinations.length == 1 && destinations[0].id == docsId ? |
33 'setupCloudPrinters' : 'manage')); | 31 'setupCloudPrinters' : |
| 32 'manage')); |
34 print_preview.DestinationList.prototype.updateDestinations.call( | 33 print_preview.DestinationList.prototype.updateDestinations.call( |
35 this, destinations); | 34 this, destinations); |
36 } | 35 } |
37 }; | 36 }; |
38 | 37 |
39 return { | 38 return {CloudDestinationList: CloudDestinationList}; |
40 CloudDestinationList: CloudDestinationList | |
41 }; | |
42 }); | 39 }); |
OLD | NEW |