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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 var localDestinations = []; | 329 var localDestinations = []; |
330 var cloudDestinations = []; | 330 var cloudDestinations = []; |
331 var unregisteredCloudDestinations = []; | 331 var unregisteredCloudDestinations = []; |
332 | 332 |
333 var destinations = | 333 var destinations = |
334 this.destinationStore_.destinations(this.userInfo_.activeUser); | 334 this.destinationStore_.destinations(this.userInfo_.activeUser); |
335 destinations.forEach(function(destination) { | 335 destinations.forEach(function(destination) { |
336 if (destination.isRecent) { | 336 if (destination.isRecent) { |
337 recentDestinations.push(destination); | 337 recentDestinations.push(destination); |
338 } | 338 } |
339 if (destination.isLocal || | 339 if (destination.isLocal) { |
340 destination.origin == print_preview.Destination.Origin.DEVICE) { | |
341 localDestinations.push(destination); | 340 localDestinations.push(destination); |
342 } else { | 341 } else { |
343 if (destination.connectionStatus == | 342 if (destination.connectionStatus == |
344 print_preview.Destination.ConnectionStatus.UNREGISTERED) { | 343 print_preview.Destination.ConnectionStatus.UNREGISTERED) { |
345 unregisteredCloudDestinations.push(destination); | 344 unregisteredCloudDestinations.push(destination); |
346 } else { | 345 } else { |
347 cloudDestinations.push(destination); | 346 cloudDestinations.push(destination); |
348 } | 347 } |
349 } | 348 } |
350 }); | 349 }); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 onWindowResize_: function() { | 680 onWindowResize_: function() { |
682 this.reflowLists_(); | 681 this.reflowLists_(); |
683 } | 682 } |
684 }; | 683 }; |
685 | 684 |
686 // Export | 685 // Export |
687 return { | 686 return { |
688 DestinationSearch: DestinationSearch | 687 DestinationSearch: DestinationSearch |
689 }; | 688 }; |
690 }); | 689 }); |
OLD | NEW |