summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/print_preview
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-29 17:39:47 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-29 17:39:47 +0000
commit6df7b5a2ccf86cc7134baa1e070d14bc7623d64c (patch)
treedb41a1171c2e33afb5fa3cc798fa5369ebb2954c /chrome/browser/resources/print_preview
parent13582f6b5aa6043c1d099ab78b86fe226939f967 (diff)
downloadchromium_src-6df7b5a2ccf86cc7134baa1e070d14bc7623d64c.zip
chromium_src-6df7b5a2ccf86cc7134baa1e070d14bc7623d64c.tar.gz
chromium_src-6df7b5a2ccf86cc7134baa1e070d14bc7623d64c.tar.bz2
Pass location and description of local printers into print preview.
OSX already uses description as display name for printers, so pass printer model instead. BUG=256223 NOTRY=true Review URL: https://codereview.chromium.org/214443007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/print_preview')
-rw-r--r--chrome/browser/resources/print_preview/data/local_parsers.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/resources/print_preview/data/local_parsers.js b/chrome/browser/resources/print_preview/data/local_parsers.js
index 91d5208..22cfded 100644
--- a/chrome/browser/resources/print_preview/data/local_parsers.js
+++ b/chrome/browser/resources/print_preview/data/local_parsers.js
@@ -15,13 +15,21 @@ cr.define('print_preview', function() {
* @return {!print_preview.Destination} Parsed local print destination.
*/
LocalDestinationParser.parse = function(destinationInfo) {
+ var options = {'description': destinationInfo.printerDescription};
+ if (destinationInfo.printerOptions) {
+ // Convert options into cloud print tags format.
+ options.tags = Object.keys(destinationInfo.printerOptions).map(
+ function(key) {return '__cp__' + key + '=' + this[key];},
+ destinationInfo.printerOptions);
+ }
return new print_preview.Destination(
destinationInfo.deviceName,
print_preview.Destination.Type.LOCAL,
print_preview.Destination.Origin.LOCAL,
destinationInfo.printerName,
false /*isRecent*/,
- print_preview.Destination.ConnectionStatus.ONLINE);
+ print_preview.Destination.ConnectionStatus.ONLINE,
+ options);
};
/** Namespace that contains a method to parse local print capabilities. */
@@ -37,7 +45,7 @@ cr.define('print_preview', function() {
var cdd = {
version: '1.0',
printer: {
- collate: {default: true}
+ collate: {'default': true}
}
};
@@ -53,11 +61,11 @@ cr.define('print_preview', function() {
is_default: !settingsInfo['setColorAsDefault']
}
]
- }
+ };
}
if (!settingsInfo['disableCopiesOption']) {
- cdd.printer.copies = {default: 1};
+ cdd.printer.copies = {'default': 1};
}
if (settingsInfo['printerDefaultDuplexValue'] !=
@@ -105,7 +113,7 @@ cr.define('print_preview', function() {
if (destinationInfo.isUnregistered) {
returnedPrinters.push(new print_preview.Destination(
- destinationInfo.serviceName,
+ destinationInfo.serviceName,
print_preview.Destination.Type.GOOGLE,
print_preview.Destination.Origin.PRIVET,
destinationInfo.name,