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

Unified Diff: chrome/browser/resources/print_preview/data/print_ticket_store.js

Issue 318293002: Revert of Revert of Generalize printer color model handling, get rid of CUPS specific case. Enable supported paper szes… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/data/ticket_items/color.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/data/print_ticket_store.js
diff --git a/chrome/browser/resources/print_preview/data/print_ticket_store.js b/chrome/browser/resources/print_preview/data/print_ticket_store.js
index 0b902f466b23fe4548c0348bbadb4776cb106a47..a39a8dbcc0cf102950609bc92ceda9e0468f1d9c 100644
--- a/chrome/browser/resources/print_preview/data/print_ticket_store.js
+++ b/chrome/browser/resources/print_preview/data/print_ticket_store.js
@@ -376,19 +376,13 @@
cjt.print.collate = {collate: this.collate.getValue()};
}
if (this.color.isCapabilityAvailable() && this.color.isUserEdited()) {
- var colorType = this.color.getValue() ?
- 'STANDARD_COLOR' : 'STANDARD_MONOCHROME';
- // Find option with this colorType to read its vendor_id.
- var selectedOptions = destination.capabilities.printer.color.option.
- filter(function(option) {
- return option.type == colorType;
- });
- if (selectedOptions.length == 0) {
+ var selectedOption = this.color.getSelectedOption();
+ if (!selectedOption) {
console.error('Could not find correct color option');
} else {
- cjt.print.color = {type: colorType};
- if (selectedOptions[0].hasOwnProperty('vendor_id')) {
- cjt.print.color.vendor_id = selectedOptions[0].vendor_id;
+ cjt.print.color = {type: selectedOption.type};
+ if (selectedOption.hasOwnProperty('vendor_id')) {
+ cjt.print.color.vendor_id = selectedOption.vendor_id;
}
}
}
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/data/ticket_items/color.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698