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

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

Issue 214443007: Pass location and description of local printers into print preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/ui/webui/print_preview/print_preview_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/data/local_parsers.js
diff --git a/chrome/browser/resources/print_preview/data/local_parsers.js b/chrome/browser/resources/print_preview/data/local_parsers.js
index 91d5208978fc04fb8f51578874175dc42097f380..22cfded94f78f6929862ecbdec7acd4719a7f6db 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,
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698