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

Unified Diff: trunk/src/chrome/browser/resources/print_preview/native_layer.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
Index: trunk/src/chrome/browser/resources/print_preview/native_layer.js
===================================================================
--- trunk/src/chrome/browser/resources/print_preview/native_layer.js (revision 275710)
+++ trunk/src/chrome/browser/resources/print_preview/native_layer.js (working copy)
@@ -168,23 +168,6 @@
},
/**
- * @param {!print_preview.Destination} destination Destination to print to.
- * @param {!print_preview.ticket_items.Color} color Color ticket item.
- * @return {number} Native layer color model.
- * @private
- */
- getNativeColorModel_: function(destination, color) {
- // For non-local printers native color model is ignored anyway.
- var option = destination.isLocal ? color.getSelectedOption() : null;
- var nativeColorModel = parseInt(option ? option.vendor_id : null);
- if (isNaN(nativeColorModel)) {
- return color.getValue() ?
- NativeLayer.ColorMode_.COLOR : NativeLayer.ColorMode_.GRAY;
- }
- return nativeColorModel;
- },
-
- /**
* Requests that a preview be generated. The following events may be
* dispatched in response:
* - PAGE_COUNT_READY
@@ -207,7 +190,8 @@
'pageRange': printTicketStore.pageRange.getDocumentPageRanges(),
'mediaSize': printTicketStore.mediaSize.getValue(),
'landscape': printTicketStore.landscape.getValue(),
- 'color': this.getNativeColorModel_(destination, printTicketStore.color),
+ 'color': printTicketStore.color.getValue() ?
+ NativeLayer.ColorMode_.COLOR : NativeLayer.ColorMode_.GRAY,
'headerFooterEnabled': printTicketStore.headerFooter.getValue(),
'marginsType': printTicketStore.marginsType.getValue(),
'isFirstRequest': requestId == 0,
@@ -279,7 +263,8 @@
'pageRange': printTicketStore.pageRange.getDocumentPageRanges(),
'pageCount': printTicketStore.pageRange.getPageNumberSet().size,
'landscape': printTicketStore.landscape.getValue(),
- 'color': this.getNativeColorModel_(destination, printTicketStore.color),
+ 'color': printTicketStore.color.getValue() ?
+ NativeLayer.ColorMode_.COLOR : NativeLayer.ColorMode_.GRAY,
'headerFooterEnabled': printTicketStore.headerFooter.getValue(),
'marginsType': printTicketStore.marginsType.getValue(),
'generateDraftData': true, // TODO(rltoscano): What should this be?

Powered by Google App Engine
This is Rietveld 408576698