| 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 * Component used for searching for a print destination. | 9 * Component used for searching for a print destination. |
| 10 * This is a modal dialog that allows the user to search and select a | 10 * This is a modal dialog that allows the user to search and select a |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 * @private | 277 * @private |
| 278 */ | 278 */ |
| 279 renderDestinations_: function() { | 279 renderDestinations_: function() { |
| 280 var recentDestinations = []; | 280 var recentDestinations = []; |
| 281 var localDestinations = []; | 281 var localDestinations = []; |
| 282 var cloudDestinations = []; | 282 var cloudDestinations = []; |
| 283 this.destinationStore_.destinations.forEach(function(destination) { | 283 this.destinationStore_.destinations.forEach(function(destination) { |
| 284 if (destination.isRecent) { | 284 if (destination.isRecent) { |
| 285 recentDestinations.push(destination); | 285 recentDestinations.push(destination); |
| 286 } | 286 } |
| 287 if (destination.isLocal) { | 287 if (destination.isLocal || |
| 288 destination.origin == print_preview.Destination.Origin.DEVICE) { |
| 288 localDestinations.push(destination); | 289 localDestinations.push(destination); |
| 289 } else { | 290 } else { |
| 290 cloudDestinations.push(destination); | 291 cloudDestinations.push(destination); |
| 291 } | 292 } |
| 292 }); | 293 }); |
| 293 this.recentList_.updateDestinations(recentDestinations); | 294 this.recentList_.updateDestinations(recentDestinations); |
| 294 this.localList_.updateDestinations(localDestinations); | 295 this.localList_.updateDestinations(localDestinations); |
| 295 this.cloudList_.updateDestinations(cloudDestinations); | 296 this.cloudList_.updateDestinations(cloudDestinations); |
| 296 }, | 297 }, |
| 297 | 298 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 onWindowResize_: function() { | 496 onWindowResize_: function() { |
| 496 this.reflowLists_(); | 497 this.reflowLists_(); |
| 497 } | 498 } |
| 498 }; | 499 }; |
| 499 | 500 |
| 500 // Export | 501 // Export |
| 501 return { | 502 return { |
| 502 DestinationSearch: DestinationSearch | 503 DestinationSearch: DestinationSearch |
| 503 }; | 504 }; |
| 504 }); | 505 }); |
| OLD | NEW |