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

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

Issue 2618313004: [CUPS] Implement the enterprise icon for printers in Print Preview Dialog. (Closed)
Patch Set: Address dbeam@'s comment. Rebase Created 3 years, 11 months 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
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 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 } 1595 }
1596 } else { 1596 } else {
1597 if (destination) { 1597 if (destination) {
1598 // In case there were multiple capabilities request for this local 1598 // In case there were multiple capabilities request for this local
1599 // destination, just ignore the later ones. 1599 // destination, just ignore the later ones.
1600 if (destination.capabilities != null) { 1600 if (destination.capabilities != null) {
1601 return; 1601 return;
1602 } 1602 }
1603 destination.capabilities = capabilities; 1603 destination.capabilities = capabilities;
1604 } else { 1604 } else {
1605 var printerOptions = null;
1606 if ('cups_enterprise_printer' in event.settingsInfo) {
1607 printerOptions = {'cups_enterprise_printer':
1608 event.settingsInfo['cups_enterprise_printer']};
1609 }
1610
1605 destination = print_preview.LocalDestinationParser.parse( 1611 destination = print_preview.LocalDestinationParser.parse(
1606 {deviceName: destinationId, 1612 {deviceName: destinationId,
1607 printerName: printerName, 1613 printerName: printerName,
1608 printerDescription: printerDescription}); 1614 printerDescription: printerDescription,
1615 printerOptions: printerOptions});
1609 destination.capabilities = capabilities; 1616 destination.capabilities = capabilities;
1610 this.insertDestination_(destination); 1617 this.insertDestination_(destination);
1611 } 1618 }
1612 } 1619 }
1613 if (this.selectedDestination_ && 1620 if (this.selectedDestination_ &&
1614 this.selectedDestination_.id == destinationId) { 1621 this.selectedDestination_.id == destinationId) {
1615 cr.dispatchSimpleEvent( 1622 cr.dispatchSimpleEvent(
1616 this, 1623 this,
1617 DestinationStore.EventType.SELECTED_DESTINATION_CAPABILITIES_READY); 1624 DestinationStore.EventType.SELECTED_DESTINATION_CAPABILITIES_READY);
1618 } 1625 }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 return this.getDestinationKey_( 1807 return this.getDestinationKey_(
1801 destination.origin, destination.id, destination.account); 1808 destination.origin, destination.id, destination.account);
1802 } 1809 }
1803 }; 1810 };
1804 1811
1805 // Export 1812 // Export
1806 return { 1813 return {
1807 DestinationStore: DestinationStore 1814 DestinationStore: DestinationStore
1808 }; 1815 };
1809 }); 1816 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698