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

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

Issue 319373004: Revert 275646 "Generalize printer color model handling, get rid ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 | trunk/src/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: trunk/src/chrome/browser/resources/print_preview/data/print_ticket_store.js
===================================================================
--- trunk/src/chrome/browser/resources/print_preview/data/print_ticket_store.js (revision 275710)
+++ trunk/src/chrome/browser/resources/print_preview/data/print_ticket_store.js (working copy)
@@ -376,13 +376,19 @@
cjt.print.collate = {collate: this.collate.getValue()};
}
if (this.color.isCapabilityAvailable() && this.color.isUserEdited()) {
- var selectedOption = this.color.getSelectedOption();
- if (!selectedOption) {
+ 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) {
console.error('Could not find correct color option');
} else {
- cjt.print.color = {type: selectedOption.type};
- if (selectedOption.hasOwnProperty('vendor_id')) {
- cjt.print.color.vendor_id = selectedOption.vendor_id;
+ cjt.print.color = {type: colorType};
+ if (selectedOptions[0].hasOwnProperty('vendor_id')) {
+ cjt.print.color.vendor_id = selectedOptions[0].vendor_id;
}
}
}
« no previous file with comments | « no previous file | trunk/src/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