Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: chrome/browser/resources/print_preview/data/destination_store.js

Issue 59843010: Print to Privet local printers (PDF only) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698