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

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

Issue 692303002: Add DPI option selection to Print Preview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not show DPI selection if there's only one option available. Created 6 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 side-by-side diff with in-line comments
Download patch
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 82332e101d711827e615b1a95bac94c825f050e6..0ca75a4ac5a076a62758b4ac7ec27e00c4344da1 100644
--- a/chrome/browser/resources/print_preview/data/print_ticket_store.js
+++ b/chrome/browser/resources/print_preview/data/print_ticket_store.js
@@ -86,6 +86,14 @@ cr.define('print_preview', function() {
new print_preview.ticket_items.Copies(this.destinationStore_);
/**
+ * DPI ticket item.
+ * @type {!print_preview.ticket_items.Dpi}
+ * @private
+ */
+ this.dpi_ = new print_preview.ticket_items.Dpi(
+ this.appState_, this.destinationStore_);
+
+ /**
* Duplex ticket item.
* @type {!print_preview.ticket_items.Duplex}
* @private
@@ -243,6 +251,10 @@ cr.define('print_preview', function() {
return this.customMargins_;
},
+ get dpi() {
+ return this.dpi_;
+ },
+
get duplex() {
return this.duplex_;
},
@@ -309,6 +321,11 @@ cr.define('print_preview', function() {
/** @type {!Object} */(this.appState_.getField(
print_preview.AppState.Field.IS_COLOR_ENABLED)));
}
+ if (this.appState_.hasField(print_preview.AppState.Field.DPI)) {
+ this.dpi_.updateValue(
+ /** @type {!Object} */(this.appState_.getField(
+ print_preview.AppState.Field.DPI)));
+ }
if (this.appState_.hasField(
print_preview.AppState.Field.IS_DUPLEX_ENABLED)) {
this.duplex_.updateValue(
@@ -440,6 +457,14 @@ cr.define('print_preview', function() {
cjt.print.page_orientation =
{type: this.landscape.getValue() ? 'LANDSCAPE' : 'PORTRAIT'};
}
+ if (this.dpi.isCapabilityAvailable()) {
+ var value = this.dpi.getValue();
+ cjt.print.dpi = {
+ horizontal_dpi: value.horizontal_dpi,
+ vertical_dpi: value.vertical_dpi,
+ vendor_id: value.vendor_id
+ };
+ }
if (this.vendorItems.isCapabilityAvailable() &&
this.vendorItems.isUserEdited()) {
var items = this.vendorItems.ticketItems;

Powered by Google App Engine
This is Rietveld 408576698