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 * A data store that stores destinations and dispatches events when the data | 9 * A data store that stores destinations and dispatches events when the data |
10 * store changes. | 10 * store changes. |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 * Called when capabilities for a privet printer are set. | 664 * Called when capabilities for a privet printer are set. |
665 * @param {object} event Contains the capabilities and printer ID. | 665 * @param {object} event Contains the capabilities and printer ID. |
666 * @private | 666 * @private |
667 */ | 667 */ |
668 onPrivetCapabilitiesSet_: function(event) { | 668 onPrivetCapabilitiesSet_: function(event) { |
669 var destinationId = event.printerId; | 669 var destinationId = event.printerId; |
670 var dest = print_preview.PrivetDestinationParser.parse(event.printer); | 670 var dest = print_preview.PrivetDestinationParser.parse(event.printer); |
671 dest.capabilities = event.capabilities; | 671 dest.capabilities = event.capabilities; |
672 | 672 |
673 this.updateDestination(dest); | 673 this.updateDestination(dest); |
674 if (this.selectedDestination_ == dest) { | 674 if (this.selectedDestination_.isPrivet && |
| 675 this.selectedDestination_.id == dest.id) { |
675 cr.dispatchSimpleEvent( | 676 cr.dispatchSimpleEvent( |
676 this, | 677 this, |
677 DestinationStore.EventType.SELECTED_DESTINATION_CAPABILITIES_READY); | 678 DestinationStore.EventType.SELECTED_DESTINATION_CAPABILITIES_READY); |
678 } | 679 } |
679 }, | 680 }, |
680 | 681 |
681 /** | 682 /** |
682 * Called when the search for Privet printers is done. | 683 * Called when the search for Privet printers is done. |
683 * @private | 684 * @private |
684 */ | 685 */ |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 return id == this.initialDestinationId_ && | 749 return id == this.initialDestinationId_ && |
749 origin == this.initialDestinationOrigin_; | 750 origin == this.initialDestinationOrigin_; |
750 } | 751 } |
751 }; | 752 }; |
752 | 753 |
753 // Export | 754 // Export |
754 return { | 755 return { |
755 DestinationStore: DestinationStore | 756 DestinationStore: DestinationStore |
756 }; | 757 }; |
757 }); | 758 }); |
OLD | NEW |